This experiment is a simple demonstration of density.
Oil floats on water because a drop of oil is lighter than a drop of water the same size, i.e. it is less dense. Things that are less dense than water will float in water. Things that are more dense than water will sink.
Even though oil and water are immiscible liquids. Salt is denser than water, so when you pour salt on the oil, it sinks to the bottom of the mixture, carrying a blob of oil with it. In the water, the salt starts to dissolve. As it dissolves, the salt releases the oil, which floats back up to the top of the water.
(There are no significant hazards associated with this experiment)