A lava lamp works on two principles: heat rises, and some liquids don’t mix.
Waxy liquid shares a glass bottle with thin, watery liquid. The bottom of the metal base underneath the glass bottle holds a light. When you plug it in and turn it on, the light slowly heats up the contents of the bottle.
After a while the waxy blobs melt, and these liquidy glops rise with heat. At the top of the bottle, they cool and drop back to the bottom to be reheated again.
What the stuff in the bottle actually is remains a secret.
The companies that produce the lamps won’t say, and chemists have come up with slightly different results when analyzing the stuff. What they do know, though, is that the waxy stuff, the lava, is probably paraffin, with perhaps a stabilizer that helps keep the blobs together when heated and moving.
The colored “water” might be just, that colored water, although most agree it’s probably an alcohol.