When oil and water are stirred together, water molecules will attract each other electrically, but they will not attract oil molecules, causing separation.
Water is a polar molecule while oil is a non-polar molecule. Water can only dissolve polar molecules and hence, oil is insoluble in water.
When water comes in contact with oil, water molecules attract each other, while the oil molecules stick together, hence, forming two separate layers of water and oil. The oil layer floats on the water layer.
Therefore, when oil and water are stirred together, water molecules will attract each other electrically, but they will not attract oil molecules, causing separation.