The Lava lamp was invented by British accountant Edward Craven-Walker in 1963 after watching a homemade egg timer, which was made from a cocktail shaker filled with liquids, as it was bubbling on a stove top in a pub.
There are two liquids in the lamp that are insoluble together and have similar densities. The heat from the light bulb heats the heavier liquid at the bottom of the lamp. It absorbs the heat, expands and becomes less dense.
This change in density is small but enough for the once heavier liquid to float to the top of the lamp. As the blob of liquid moves away from the lamp it cools. This increases the density and it sinks back to the bottom of the lamp. This motion is repeated over and over again creating the continuous motion of the liquid in the lamp.
The interactions between wax and liquid are not an exact science. Your colouring may differ from the image depicted, and may change throughout use.