The cost is not close when you consider US tech employees who earn almost double what EU and UK employees earn. Corporate taxes in the UK have traditionally been lower than the US and UK companies don't pay for medical insurance. It's simpler and cheaper to launch a startup in the UK compared to the US.
I doubt the situation is much different between US and German or German and Irish companies. It's rare in my experience that companies can explain away salary differences by showing cost differences. Which should shock no one. Most companies seek to minimize labor costs and pay close to local market rates. If instead they were seeking to share profits you might see the result you're describing.
There are similar employer taxes (at somewhat lower rates, topping out at ~11% vs ~18%), but the total cost of employment in Dublin is much higher than Berlin.
Also, in Germany you have a lot of holiday (20 minimum, most companies pffer 30), 3 month notice period, 3 years parental leave (per child), pricing these in, I would always expect lower salary in Germany.
Commercial property, services, etc are far cheaper in Berlin. Hence why it's common to move start-up dev teams from Dublin to Berlin to save money. My own experience is that Berlin is significantly cheaper to employ developers in particular.
I bet that the total cost per employee is pretty close.