There are lots of ways that, even in a democracy, widely hated politicians can remain in power. Gerrymandering, low turnout, voter apathy, split voting, etc.
Poland's 2020 election was very controversial, and Duda won by the slimmest of margins.
Actually, it is not that simple. It is widely hated in upper-class, well educated residents of large cities, and very popular in rural areas where people are less wealthy.
They are the first government that openly buys votes. They focus on their core groups, that is mainly elderly people, and promise them money if they vote for them, at the same time scaring them saying that if they vote for the opposition, this money will be taken away. It is one of the main reason that in spite of universal hatred they still have 30% support, mainly from the elderly.
If giving financial incentives to voters is buying voters, they're certainly not the first government that openly buys votes.
In this case it was plain and simple one off cash payments targeted at their core voter base. I don't think many governments are as blatant as that.
In the US, we had COVID relief checks and student loan debt forgiveness in the last couple years, both of which seemed like pretty blatant vote-buying attempts.
I argue this is stuff you should always expect from a functioning state - education and health services. And especially because they are universal, they would buy voting support from... everyone?