The science behind a homemade lava lamp
The secret behind the lava lamp is liquid density – in this case, how much matter is packed into the different liquids.
Oil and vinegar have different densities. Vinegar is more dense than oil, so this is why it sinks to the bottom of the glass.
Once it reaches the bottom, it touches the bicarbonate of soda. This causes a chemical reaction that releases bubbles of the gas carbon dioxide. The bubbles of carbon dioxide attach themselves to the vinegar and cause it to float to the surface with them.
But once the carbon dioxide bubbles reach the top, they escape into the air. So now the vinegar globules start to sink again.