What is the component in oil and gasoline that causes them to separate when they are mixed with water?
Not sure I understand the question.....
Neither oils nor gasoline "separate" split apart into various components) when an attempt is made to mix them with water, they just do not mix.
This is because gasoline and (mineral) oils are essentially non-polar, whereas water is highly polar, and has a tendency to easily form hydrogen bonds. To be able to achieve complete miscibility the interactions between oil and water would need to be more favourable than those between water and water. The intermolecular forces between oil molecules, however, are weak van der Waals forces, which cannot overcome hydrogen bonds. As a result, water and oil form separate layers.
But there is no "component" in oils that makes them do this - its a property of the oil per se.