Ruth says they left Bethlehem because there was a famine in the land. Elimelech went with Naomi and their two sons to live in the country of Moab. The move is introduced at the start of the story in Ruth 1:1–2.
Ruth opens during the era of the judges, when a famine hits the land and pushes a family from Bethlehem in Judah to relocate temporarily in Moab (Ruth 1:1). The man, Elimelech, travels with his wife Naomi and their two sons. After settling in Moab, Elimelech dies, leaving Naomi with her sons. These verses function as the story’s setup, quickly establishing time period, location, and the central problem that will drive the rest of the narrative: Naomi’s family line and security collapse through repeated deaths.
Ruth opens by placing its story “in the days when the judges judged,” signaling a hard, unstable era for Israel (explicit claim). A famine then drives a family from Bethlehem in Judah to seek food by living for a time in Moab (explicit claim).
A careful answer keeps the immediate passage, the book's argument, and the whole-Bible storyline together, so the question is answered in context instead of as a detached idea.
Start with Ruth 1:1-2, then read the surrounding section so the answer stays connected to the passage's flow.
1It happened in the days when the judges judged, that there was a famine in the land. A certain man of Bethlehem-judah went to sojourn in the country of Moab, he, and his wife, and his two sons.
2The name of the man was Elimelech, and the name of his wife Naomi, and the name of his two sons Mahlon and Chilion, Ephrathites of Bethlehem-judah. They came into the country of Moab, and continued there.