No two transistors are exactly identical, and one of them always conducts more than the others. The hottest transistor in the amp draws more than all the others until it fails and causes the entire amp to shut down. They also incorporate circuits that monitor output device temperatures and act to limit the conduction of current in the event of excessive temperatures. In such a case, the amp may continue to output power at a reduced rate. In extreme conditions, the protection circuitry may actually turn the amp off in order to allow it to cool and save itself from certain destruction.
Many factors can cause thermal instability.
Shorted speaker wires, excessive output loading, signal overload, and high ambient temperature are the usual causes. The hotter the surrounding air, the less of a thermal stability margin the amp will have. If the air around the amp is hot enough, the amp will have no thermal margin and it will become unstable. Although not usually published, most amps have a thermal stability margin that can be calculated. At a certain temperature, the amp can dissipate a certain amount of heat and produce a certain amount of power.