Genesis 14:4

Twelve years they served Chedorlaomer, and in the thirteenth year they rebelled.

Twelve years they served Chedorlaomer, and in the thirteenth year they rebelled belongs to the account of Chedorlaomer's invasion of Canaan, when several subject princes revolted and came into conflict with the Elamites. Canaan had been made tributary to Chedorlaomer, the Elamite king, serving him for twelve years before rebelling in the thirteenth year. That rebellion caused Chedorlaomer and his allied kings to return to Canaan to subdue the revolting cities.

That return produced the invasion and captivity connected with the verse, from which Abraham later rescued captives from the Elamites. Abraham then defeated greatly superior forces, and his victory drew attention to the true faith as evidence of divine power. Abraham's treatment of the prisoners and the spoil in that victory showed a noble, unselfish spirit.