I won't speak to C4 directly, i'll speak to nitroglycerine. I suspect C4 is similar but more stable.
When the TNT molecule is jostled, its three long, unstable arms of NO2 start to wobble. With enough energy, the arms can break off. These NO2 bits are much more happy as N2 and H2O, so they reform as lower energy compounds. So:
1] energy is released as heat.
2] these new compounds are gaseous rather than solid, and take up much more room. So the CO2 and water and other compounds expand - very rapidly.
So, the upshot is
- a change in chemical compounds, resulting in
- the release of several gases that want to expand to their equilibrium pressure, as well as
- the release of a lot of heat which
- is part of the expanding cloud of destruction as well as
- jostling other nearby molecules, setting them off in a chain reaction
That all happens very, very fast. We call this an explosion.There's more you can study, such as:
- the initial shape of TNT
- the final byproducts
- the differences that make C4 far more stable than TNT
but the above is the gist.