David said in his heart, I shall now perish one day by the hand of Saul: there is nothing better for me than that I should escape into the land of the Philistines; and Saul will despair of me, to seek me any more in all the borders of Israel: so shall I escape out of his hand.
The mention of David and his men bringing their wives and families into Gath indicates that the increasing danger to those families was one of the considerations that led David to this action.