I don’t think it was just targeted at the Ukranians. People were starved all over the place, even Stalin’s native Georgia was not spared.
It was the extermination of a “class.” The supposed “Kulaks.” Any landed peasants who resisted forced collectivization were to be starved to death.
The famine was spread all over the USSR, but was worst in Ukraine, because there was a strong independence movement there when the Russian Empire fell. Moscow decided to starve out the Ukranians to conquer them.
Actually, famine and starvation were always frequent in Russia, even after WW2 when lend-lease ended and the food-producing areas of the USSR were ruined and de-populated. One reason so many Axis POWs died was that the guards stole their food to feed their own hungry families.