When you mix elements like this and this displacement takes place it is called a chemical reaction. Chemical reactions happen every day and you don't probably even think about it. It's this type of reaction that is used in hand warmers and glow sticks.
When a chemical reaction happens it sometimes releases a lot of energy. This energy is often released in the form of heat. This release of energy can sometimes be so strong and fast that it is explosive.
There are other reactions that don't release energy, but suck energy up. When a reaction sucks energy from around it, the most common energy available is heat. It basically turns the area around it cold. Sometimes it becomes so cold so fast it too is explosive. Depending what container it is in, it can cause the container to shatter.
This is a good thing to keep in mind in certain workplaces. This act of displacement reactions is why it is best to not mix different cleaners in a closed room.