1. Leadership is autocratic / non-democratic and thus a natural ally. That's the easy bit, but why does the populous support Russia.
2. Poland and other eastern bloc countries are doing a lot better than Hungary, which makes common folks disaffected.
3. State control of the media is pretty strong, and it blames the west for their problems.
There's a similar narrative for Serbia, but historical reasons also play a big role. The politics and history of that region are "interesting".
The more autocratic a country is the more it is sympathetic to Russia. Autocrats like that autocrats can take what they want.
I assume it's the same thing that's up with the German far right: they consider themselves in opposition to the EU / Berlin and the enemy of my enemy is my friend.
While that's also somewhat true for Poland, Poland likely calculates the risks differently based on their specific history with Russia. They don't want to become as progressive as Germany, but unlike a renewed Russian empire they don't see Western progressiveness as an existential threat to Polish independence.
IMO, another big difference is that they have both a direct border with Russia (Kaliningrad), and a larger border with Belarus - a country that is fine with Russia launch an invasion from their territory. When you're next to a country that is openly talking about reforming the USSR by force, and is actively in the process thereof, it can be pretty scary.
In contrast, Hungary is sufficiently far away from Russia that they can afford to focus more energy on more immediate rivals.
It's also interesting to see how strongly the Baltic nations and Poland are pushing to support Ukraine, since they lived long enough under the Soviet heel and they definitely don't want to get back to that.
I have no idea what's up with Hungary though.