Ok, so I do understand that there were the Bolsheviks and the Mensheviks. In school we learned that Soviets consisted of the peasantry, the industrial workers, and the soldiers. But later on, the soldiers formed together with the workers a worker's government, the Petrograd Soviet, while the Provisional Government still failed to fulfill the demands of the rest of the people, until Lenin was sent back to Russia. What I don’t understand is if you count the soldiers as the ones supporting the Bolsheviks or the Soviet. So do the Soviets belong to the Bolsheviks or vice versa or am I completely off track?
Yes, you are almost completely off track:-) The situation was a) much more complicated, and b) quickly changing with time during 1917-1918.
Bolsheviks and Mensheviks were the split parts of the Social-Democratic party, (SD) which in 1917 was a minority party in all respects. So one cannot say that they expressed the views of the majority of workers, peasants or soldiers.
More popular party (on the left wing) was Socialist-Revolutioners (SR) supported by many peasants, and Anarchists, supported by soldiers. The SR party was also split into "right SR" and "left SR". There was plenty of other parties from from liberal democratic (KD) to monarchist.
At the time of October revolution, the Provisional government was headed by a right SR (Kerensky). Many other parties were represented in this government. It was called Provisional because its stated goal was to maintain the order until the Constitutional Assembly, which was supposed to establish a new constitution.
The leadership of the Soviets changed with time between Mensheviks and Bolsheviks, and various Anarchists played an important role.
When in November (October, old style) Bolsheviks took the power by a coup, they dissolved by force not only the Provisional government, but also the elected Constitutional Assembly (the largest party represented in this Assembly was SR, but most other parties were represented as well). Constitutional Assembly which was elected by broad popular elections was banned and dissolved by brute force.
All parties except left SR refused to co-operate with Bolsheviks after the this coup.
So the first government after the coup consisted of Bolsheviks and the left SR, but soon (within 3 months) all SR were expelled by brute force and Bolsheviks established a dictatorship of their single party.
To counter popular resistance they introduced Red Terror as their official policy in 1918, physically exterminating all their political enemies. This started a civil war which Bolsheviks eventually won in 1922.
This is a VERY rough outline of what happened in 1917-1918.
I recommend the excellent book Orlando Figes, People's Tragedy. The Russian revolution 1891-1924, which describes the revolution in detail. One of the best books on the subject. The author seems to be genuinely interested in what has happened, rather than in promoting some pre-established views.
(Many books written in 20-th century were strongly influenced by powerful Soviet Communist propaganda, which completely distorted history. This includes many books by Western authors. Other books, much fewer in number, written by the "whites" are also usually driven by their agenda).
Let's start with some basics. A "Soviet"is a "council" and the St. Petersburg (later Petrograd) Soviet was a workers' council started in 1905. (There were Soviets in other cities, but none as influential as St. Petersburg/Petrograd.) In 1915, the Menshevik political group organized a group of workers' mediators called the Central Workers' Group (CWG). These mediators were arrested in January, 1917 by the Tsarist government, and freed in February 1917 by soldiers. This made them heroes with the workers so the (workers') Petrograd Soviet and the CWG (freed by soldiers) essentially merged.
In October, 1917 (actually November, 1917 on the Gregorian calendar) the Bolsheviks began the Russian Revolution with the slogan, "Peace, Land, Bread," which appealed to almost everyone, but particularly to war-weary soldiers. They took over the Petrograd (and other) Soviets, and forced the parties of their enemies to dissolve.
So a brief answer to your question is that the Soviets came first, the soldiers initially supported the Petrograd Soviet, and later the Bolsheviks took over the Soviets, in large part through the support of soldiers that had been won over by the Bolshevik slogan of "Peace, Land, Bread." One important military group that helped the Bolsheviks come to power was the "Lettish Guards" or Latvian Riflemen in St. Petersburg.