Why does an oil-and-vinegar salad dressing have two separate layers?
Oil is nonpolar and less dense, and vinegar is polar and more dense.
Like dissolves like. A polar substance will not dissolve a nonpolar substance. In the case of oil and vinegar, the vinegar is polar and more dense than the oil, so it settles on the bottom of the container. The oil is nonpolar and less dense, so it doesn't dissolve in the vinegar, and it floats on top.