With great variations between member states. Germany has long notice periods, Greece has as short as 2 weeks notice.
> how this isn't indentured servitude
Labour law extends similar protections to employees. A long notice period simply levels the playing fields by returning some protection to employers. That's why in the EU there aren't mass layoffs like in the US right now, or riots, or mass shootings.
> (What happens if you ignore it?)
Maybe nothing, depends on how litigious the employer is. Usually a shorter notice period can be negotiated, eg. by agreeing to some un/pre-paid post-departure consulting for the previous employer.
> I can't imagine how a future employer can wait a full quarter
It's about planning. I wouldn't want to work for an employer who is hiring in panic because they haven't foreseen labour needs. I'd be afraid that they'd let me go as easily as they have hired me.
> so this must greatly restrict labor mobility
Yes
> and hence wages
That is why you are trying to hire in Europe, aren't you?
> How is this legal, in the famously pro-labor EU?
Because it is literally the law.