Liquid floating on top of water due to density or insolubility?
Both are contributing factors.

The insolubility ensures that it does not mix with water.

The lower density of the liquid on top ensures that it stays on top of the water instead of below the water.