When things heat up they expand. The yolk of an egg contains lots of water, and this starts to expand upon getting hot. In boiling water this is fine, but in a microwave the yolk can reach temperatures so high that the water vaporises. Eggs have a shell and within that there is also a membrane. If the pressure of the rapidly heating yolk exceeds the breaking pressure of the shell and membrane, the egg will explode.
Rik Sargent, Science Museum