i'm no economist... but didn't externalizing a lot of production offset the missing population growth? So germany just externalized raw material extraction and production but still kept the profits?
Germany has also "climbed the value ladder" focusing on production of high-value goods whilst counting on imports to provide for low-value ones.
Some of that is of course classic Ricardian "comparative advantage" of trade. Much is, though, outsourcing high-impact / high-resource / high-effluent production to elsewhere.