I always use prepaid as i hate nasty contract surprises and also because its actually cheaper here with most carriers!
Actually I take that back, shady shops will sell you a SIM that can't be activated.
Things do change, so I did a quick internet search. Found plenty of websites with information on how to purchase and activate sim cards.
https://www.phonetravelwiz.com/buying-a-sim-card-in-germany-... https://abrokenbackpack.com/germany-sim-cards/
many others.
In that case customer identification is commonly done via the post office's Postident system (either at a physical post office, or online via video) or via some alternative video chat system, and those might not work for all passports from all countries worldwide.
Which countries? Of the few countries I traveled to, the cheapest esim (by using a esim comparison site) is cheaper than local sims for any reasonable amount of data (eg. 3 GB for a 2 week trip). The local sims sold at the airport might be "cheaper" on a per-GB basis, but they come with absurd amounts of data that you couldn't possibly use (eg. 30GB) so they are more expensive in actuality.
That means I assume they are paying roaming rates to the local providers.