German car makers got lazy with research and development. In addition, they were hesitant to give up their investment in ICE production, risk staff reductions, and corresponding political and strike problems. This lead to most of the knowledge around EVs being developed and patented elsewhere, especially battery knowledge is firmly in Chinese hands.
At the same time the grandparent is also right, China wisely required knowledge transfers (in the form of forced joint ventures) in exchange for production and sales licenses. German car makers stupidly and greedily agreed, providing the Chinese with valuable knowledge about all the other parts of a car.
Both those mistakes now mean that Chinese companies have all the necessary patents and knowledge, as well as experience, for building EVs. Whereas German car makers will need to buy, license and beg for parts in China.
Not to mention that production in China will of course always be cheaper, and bureaucracy easier in the relevant circumstances.
Shipping and trade barriers are still significant for vehicles. The fact that BYD is looking to build a factory in Europe rather than importing from China shows that local manufacturing still has an advantage.
So you would have bet the future of an entire industry in the German governments ability to actually get the electric grid ready for everyone moving to EV?
No, that isn't a relevant risk. German car companies are mostly export-oriented. Of course the home market is mostly theirs, but if Germany were to lag behind on EV viability, foreign sales can still be sufficient to create a viable EV business. It would never have been a hard transition anyways, EV production would have been slowly built up while ICE production were ramped down accordingly, just as sales figures guide.
Plus there is no infrastructure to actually charge them. Plus our electric grids do not support millions of electric vehicles. Plus, you may realize that in Germany we emit a sh*t-ton of carbon dioxide for generating electricity that ball-park wise you may only save about 25% compared to a regular car (e.g., 25% charging losses, 400 g/kWh carbon dioxide intensity in Germany,…)
The funny thing is: even if we had the infrastructure, right now it costs ~0.50€/kwh to charge on public chargers. Apposed to ~0.30€/kwh which I pay at home. Unfortunately I don't own a home and can't have my own charger. This + that I don't want to sit at a charger for 45m once a week is, for me personally, the strongest argument against buying an electric car right now. And I don't see that changing or plans to change that.