Since Covid times every other political parties in Germany seems to be under the impression that they are somehow holier and knows what is best for the people and what people wants doesn’t matter and the politicians decide what people deserves. The pinnacle of this is the current Chancellor of Germany which is arrogant, completely broke his election promises and keep on pushing the voters that are in the centre right or centre left towards the respective extremism.
Another important factor is the current German economy. When the economy was somewhat in good shape after Merkle’s government people mainly voted for the Greens whose main agenda is climate change back in 2021 because people had good living standards and they could afford to focus on solving world problems. But the current economy is imploding and a lot of people are losing their well paid jobs and no other party seems to be even talking about it except for AfD and somehow the current government is under the delusion that economy is doing far better than they have thought. This again is a reason for a lot of people to vote for AfD.
Last but not least is the Islamic extreme/terrorist attacks that happened past years. There have been multiple incidents of cars been driven into crowd including in Christmas markets and latest attack in the Gay pride in Berlin this year. That has been used by AfD to emphasise the incompetence of the current and previous governments to ensure the internal security of the country to gain even more votes