First, be aware that the Russian Revolution itself was closely tied with the experience of World War I. Russia was suffering deeply in the experience of the war. According to one historian's statistical record, out of approximately 18 million troops mobilized, Russia faced over fifty per-cent casualties, with 1.8 million dead, almost 5 million wounded, and over 2 1/2 million either taken prisoner or gone missing (statistics courtesy of John Merriman, A History of Modern Europe, 3rd edition (New York: W. W. Norton, 2010), p. 924. Merriman himself cites another historian, J. M. Winter). At the same time, the experience of the war was creating severe food shortages at home.
This resulted in the Russian Revolution, with Tsar Nicholas II abdicating and a new provisional government set in place. However, the provisional government made the decision to continue the war, which helped the Bolsheviks launch a second revolution against the Provisional Government. After the Bolsheviks took over the government, they signed the Treaty of Brest-Litovsk, pulling Russia out of the First World War.