Isn't this a "worst case scenario" for Europe? How did the Russians convince Germany to make their economic machine dependent on Russian-supplied natural gas?
I think the answer to your question is "gradually, by being reliable for decades". The contracts in question were signed in the seventies.
Germany's general foreign policy may be described as paying for things to achieve mutual dependance. Having Germany depend on Russa and Russia really depend on Germany would be a classic German move. Note that when Russia wanted to bypass Ukraine and Belarus, it somehow ended up building two pipelines to Germany, none to Italy, none to India and a remarkable small one to China. That second pipeline to Germany looks like a bit of a WTF if you ask me.