It's very rare for a microwaves door to shatter but it does happen from time to time and could be caused by a defect in the microwave door or it could be caused by some unseen damage that happened either during moving or transporting the microwave from the factory or the store.
The thermal cycling of the microwave can cause the microwave door to shatter due to impurities in the glass.
The constant heating up and cooling down then causes microwave door to shatter.