Here is a terrifically fun video that demonstrates the explosive nature of liquid nitrogen reacting to the temperature differential with water through the use of a garbage can and table tennis balls.
Wired Magazine explains some of the math. They use a different demonstration using more water and rubber ducks. Thus the variables are different, but the principle is the same.
But with liquid nitrogen, it explodes because it essentially “warms up.” So, the bomb itself increases in thermal energy. Crazy if you think about it. So, how does this work? Well, let’s assume the liquid nitrogen start’s at its boiling point (-196°C). In order to make the transition from a liquid to a gas, it needs energy. The amount of energy depends on the amount of material that makes the transition as well as the type of material. This is constant multiplied by the mass is called the latent heat of vaporization. It can be expressed as:
Since this liquid nitrogen is much colder than the water, this increase in thermal energy for the nitrogen must itself come from the water. The water has to get colder. In a sense, that is where the energy to increase the height of the water comes from. It comes from a decrease in thermal energy of the water.
There are more details in the Wired article, and if you are physics minded, you should be able to do the calculations for the ping pong balls. Or you could just watch the videos and enjoy the results and think that science is fun.