The short answer is that the triumph of the Bolshevik revolutionaries inside Russia led to the end of the Russian involvement in the war. When the communists took over in 1917, they decided that the highly unpopular and destabilizing war was sacrificing the working classes for the financial interests of the wealthy. Therefore, they withdrew Russia from World War I.
However, it was the mismanagement of the war effort by the Czar and other high officials that led to a situation in which the communists could take over the government. The Russians, who had been defeated militarily by the Japanese in 1905—a surprise loss—were unprepared to enter the war in 1914. While war could have been an opportunity to pull the country together in patriotic union, the defeats the Russians experienced and the sufferings on the home front tore the country apart.
Food shortages meant that both troops and people at home were going hungry. High war casualties upset people. Ordinary citizens, looking for a scapegoat, turned on the Czar's wife, Alexandria, as a traitor to Russia who was actually working for the enemy. All this led to a breakdown of faith in the Czar's leadership that led in turn to a communist takeover, Russian withdrawal from the war, and then a civil war.