In an atmosphere of prevailing forms of Social Darwinism in Germany during the late 19th and early 20th century the idea of increasing Germany's strength by encouraging migration to Germany's colonies spread. It was thought that sending settlers to colonies could be an attractive alternative to simply trading in their raw materials.
Moreover, during the years immediately preceding World War One, the focus of this colonialism shifted from the settlement of overseas colonies to the idea of conquering territory in eastern Europe, and of settling it with German peasants. The leading advocate of this notion was the influential chauvinist pressure group, the Pan-German League, and its associated propagandists.
Following the outbreak of the war, the Pan-Germans seized the opportunity to present a programme of war aims advocating the seizure of large areas of western Russia. The idea was that after most of the indigenous population had been cleared, German farmers would settle the land. The settlers were to consist mainly of war veterans and urban workers, who were meant to be the key to ensuring the 'physical and ethical health' of the German nation.
The crucial turning-point in the development of the Lebensraum programme occurred when German armies conquered Poland and western Russia after 1914. A German military regime (Oberost) was established in the Baltic provinces and in part of White Russia, under the command of General Erich Ludendorff. The situation became formalised with the treaty of Brest-Litovsk, signed by the new Soviet regime in March 1918.
Hitler had already started his political career in 1919, and had been influenced by this kind of Pan-German thinking. But he was not yet clear about where the expansion should take place, nor about what alliances he would need in order to achieve it.
The final elaboration of Hitler's programme for acquiring Lebensraum occurred while he wrote Mein Kampf during 1924-1925. Essentially, this involved his study of 'geopolitics', that is, the impact of the environment on politics, which provided him with a quasi-scientific justification for the plans he had already worked out.