The bubbles explode because they superheat. The oil prevents the nucleation of steam bubbles you get when heating water in a pan, and the water drops turn to steam all at once and of course the steam expands explosively.
Even though water and steam are in equilbrium at 100°C there is a potential barrier to formation of a steam bubble. This is because small bubbles have a high pressure (the pressure is inversely proportional to the bubble radius) so you need a lot of energy to start a bubble. When you heat water in a pan you'll find steam bubbles nucleate at defects (e.g. scratches) in the pan surface. You'll often see streams of bubbles coming from the same point.
In your experiment the oil probably dewets the water droplets from the skillet so you have a water drop surrounded by oil and there is nothing to act as a nucleus. If you heat the oil slowly the water drops will superheat until eventually the temperature is high enough to nucleate bubbles. At that point part of the drop will turn into steam almost instantly and then expand explosively. You can work out how much of the drop vaporises by multiplying the superheating (i.e. the temperature - 100°C) by the specific heat of water, and then dividing this energy by the latent heat of vaporisation. As I recall, only a relatively small part of the drop vaporises, but of course this generates a large volume of steam
Even in ideal circumstances there is a limit to how far you can superheat the water. At some point the superheating is so great that nucleation will be triggered just by random fluctuations in the water. You couldn't superheat indefinitely even in perfectly pure oil and water in zero G. Obviously in your experiment the bubbles nucleate a lot earlier than this.
You get the same effect heating distilled water in a microwave oven. If you use pure water and a clean glass bowl there is nothing to act as a nucleus for the steam bubbles and the water can superheat. Sadly you often discover this as you remove the bowl as the vibration can induce nucleation and an explosion of steam - hopefully not in your face!
In an ideal gas
![ideal gas](https://i.stack.imgur.com/uLr1V.png)
where P is the absolute pressure of the gas, V is the volume of the gas, n is the amount of substance of gas (measured in moles), T is the absolute temperature of the gas and R is the ideal, or universal, gas constant.
The capped gas in the bottle cools coming to a thermodynamic equilibrium , through conduction to the walls, and also according to the black body radiation # law everything cools at a certain rate. In the formula above the combined pressure times volume has to become smaller. If the walls are not rigid the imbalance of the inside pressure to the outside compresses the wall until pressure equilibrium is reached. The same is true if you put a capped half empty bottle in the freezer.
- - - - - - -
#it has been pointed out in a comment air does not follow the black body radiation formula well , it has small emissivity and conduction has to be the main cooling mechanism.
Best Answer
The liquid water changes phase when heated above the boiling point, namely it becomes a gas. When water vapor in cavitation bubbles escapes fast, it makes a mess. The sound of splashing aside, notice that nothing happens if the oil is cold.
Related fun fact: The pistol shrimp is so loud, it kills other fish by snapping with its claw.