> But how did they get there? didn't the people from the former German Democratic Republic
It's not that complicated really, the eastern parts of Germany are on average poorer, older and less educated than the western parts, well paid jobs are rare, unemployment is higher (although tbf I'm unfair here towards the old generation, since those are not the typical AfD voters - it's rather the young people who tend to vote on the extreme ends of the political spectrum). Most of the smart young people move to where the grass is greener, those who stay are often bitter and disillusioned.
Carve out a similar demographic slice in western Germany, and you'll get similar high support for the AfD.
...basically the same reason why MAGA is bigger in the rural areas of the US than in the big cities.