Because the overall market skews towards lower salaries, even multinationals and the few local tech companies that exist there can pay less in Berlin.
Pay is also generally higher in the US, though usually not to this extent.
The business culture of the SF tech scene demands long hours and intensity that most Europeans cannot imagine, having not lived in the environment.
American wages come with sacrifice.
And there are actually plenty of crappy jobs with overtime in Germany too. Lower pay does not always mean less expectations.
You can work as hard as you feel like, charging generous hourly rates.
Just don't be surprised when big corp decides to consolidate external contractors into more well known contracting companies, delivering from Eastern Europe or Asia.
Money isn't everything in life, and depending on the case it doesn't even buy health.
US SWEs have it much better than Germans across the whole country, there's no need to deny that. Berlin is also a bit of a bubble.
From a quick search, electricity in Germany seems cheaper than in California.
And then there's vacations, work-life balance, health care, education.
Raw salary figures don't tell the story.
I'm paying close to $30K in health care costs, that's assuming nothing out of the ordinary. If something bad happens it can be in the millions, bankrupting entire life savings.
If I'm lucky I can squeeze in one week of vacation a year (that's what silicon valley "unlimited vacation" means). Meanwhile I have family in Austria taking 6-8 weeks of vacation every year.
But finding a place with European levels of vacation? Impossible. I'd give anything to work 25% of my hours for 25% of the pay, but such jobs don't exist.
And US healthcare problems of course can't be changed by changing jobs (I've had the exact same Blue Shield PPO plan across 7 employers in the previous decade+).
Fist, SF salaries are high as is cost of living. Perhaps compare to Dallas. Or even Toronto.
Then there's social insurance aka pension. A SE in the US I'd assume to have healthcare (caveat - as long as in employment). An in terms of private investment such as stocks, the German stock market is quite different from the US one in terms of composition (as companies raising funds tend to use different means) hence future asset-liability matching. And a fair bit harder to do your own company (and VC funding) in Germany due to 'esoteric' tax requirements for companies (including but not limited to needing to pay tax in advance).
Some peoples value other things than money so it is a bit silly to just talk about $$$. What about housing costs, commute, healthcare, quality of life, etc of the _general_ population (and not only developers)?
Average salary in San-Francisco for developers: $175.036
Average salary in Germany for developers: 61.176 Euro
That's 2.5 times more than in Germany. Please also note that many products like gas, electricity, laptops, smartphones are cheaper in the US, despite much higher salaries.