Right at the beginning, Megillath Ruth (The Book of Ruth) teaches that there was a famine in the Land. However, G-d didn’t command any Jew living in the Land of Israel to move to another country, as He did with Avraham. Just remember: Avraham was told to go down to Egypt due to a severe famine in Canaan.
Many commentators state that the famine in the days of Elimelech wasn’t that severe and people didn’t starve to death. Nevertheless, Elimelech took his family and moved to Moav. There are opinions that wealthy Elimelech didn’t want to share his money and possessions with the poor. We don’t really know the reason why he moved but he ran away from the famine and from the Land of Israel. This was his big mistake because he should have stayed. Just like everyone else.
Let us assume for a moment that Elimelech had not gone to Moav but stayed in Bethlehem (Beit Lechem). Then how could have Ruth become the great-grandmother of King David? Ruth was meant to be King David’s ancestress. Meshiach is supposed to come from Ruth, the Moabite.
So, didn’t Elimelech have to go to Moav in order to get Ruth into his family?
Not necessarily, as G-d acts in very mysterious ways.
If Elimelech had stayed in Bethlehem, then Ruth would have felt an urge to come to Bethlehem. For whatever reason.