- Many younger people are leaving the land to find work in the cities.
- Many people leave the land to find work in towns and cities.

(Advanced Oxford Dictionary)

I can't understand why is used "the" in the first sentence (the cities) and is not used "in cities" like in the second sentence.

There is no grammatical reason. It just sounds better to whoever wrote it. Sounding good is very important in English. In this case a long version sounds better, I assume.
I'm looking for a word I can't think of - something like "concept." The definite article in this case doesn't mean particular cities. It's like "the country vs. the city." "I'd love to be at the beach right now." "I'm sick of being a farmer and working the land." (not a particular beach or particular plot of land)

Your second sentence is a list of categories. You could use "the," but it's more natural without. "I prefer to walk without shoes and socks" "Could you please bring [the] drinks and [the] dips to the party? In this last sentence, "the" is optional, as it is in the second sentence you posted. You could also make it less definite, with "some drinks and some dips." (some towns and some cities)

Best wishes, -- A.