Many of them were forced to by Russians, or given no other option as other escape corridors were not open. Many did so because Russia was the closest bordering country or the easiest to get to. Many chose to do so because they were ethnic Russians or Russian-speaking Ukrainians who bought in to the BS of Russian state propaganda.
Can I check the source?
https://en.wikipedia.org/wiki/2022_Ukrainian_refugee_crisis#Countries