Each of the liquids has a different density. One way to think about density is how thick and heavy it is.
The liquids with lighter densities will float. The liquids with heavier densities will drop to the bottom.
Some of the liquids will mix together because the chemicals will dissolve each other -- like the detergent and water.
Some of the liquids will stay separate because some of the liquids do not mix together -- such as oil and water.
What about trying to put the lighter density liquids in first? Do you still have layers?