The prophet Gad said to David, Don't stay in the stronghold; depart, and get you into the land of Judah. Then David departed, and came into the forest of Hereth.
So he actually crossed over in the area of the Dead Sea, went over to the other side to Moab and there he established his family. Now he knew that Saul's anger against him would ultimately turn against his family.