1 Samuel 30:13

And David said unto him, To whom belongest thou? and whence art thou? And he said, I am a young man of Egypt, servant to an Amalekite; and my master left me, because three days agone I fell sick.

The young man encountered by David's company was an Egyptian by birth who served as a slave to an Amalekite owner. His master had deserted him three days earlier when he became sick and unable to continue. Abandoned in that helpless state, he was therefore available to act as guide for David's men to the enemy encampment, and through that service they recovered the captives and the spoil. This incident belongs to David's victory over the Amalekites before his kingship, a victory after which he acceded to the kingship of Judah.