This is based on the principle of "like dissolves like". Ethyl alcohol and water are both polar in nature, and thus are of same type. So they mix uniformly and produce a homogeneous solutiom. Oil and water, on the other hand are of opposite nature as water is polar but oil is non-polar. So, they do not mix and the layer separates them in a solution. So, they form a heterogeneous solution.

Hope this helps:)
2 3 2
Please click on the thanks button!!!
i have already seen this answer