Batteries will have unique encrypted codes (readable by the device), so only original ones from the manufacturer will work. Pretty easy for manufacturers to justify that, based on safety and liability.
Then the replacement batteries will cost more than a new phone.
They did it to kill two birds with one stone - Prevent repairs, and to prevent theft, and it works.
A few years ago you would use Find my iPhone and see your stolen device was halfway across the world in a few days because it was stolen for parts, stripped down, remade and sold as refurbished. Now it's much less common because it's so much harder.
If they only wanted to prevent theft, they could have had the same system, but only lock iPhone parts once that iPhone is reported as lost (i.e Find my iPhone was used on it, and it wasn't later confirmed as being found)
AFAIK even original parts don’t work. I heard even if you get a Apple battery the serial must be teached by a Apple technician. Otherwise you will still get warning messages
Well some sneaky legislative aide in EU already thought about that.
Any natural or legal person that places on the market products incorporating portable
batteries or LMT batteries shall ensure that those batteries are available as spare parts of
the equipment that they power for a minimum of five years after placing the last unit of the
equipment model on the market, with a reasonable and non-discriminatory price for
independent professionals and end-users.
Software shall not be used to impede the replacement of a portable battery or LMT battery,
or of their key components, with another compatible battery or key components.
apple does this but, it's outlawed by the same regulation that this is. Batteries must be easily accessible and there must not be software restrictions for them