Re: Space Shuttle
The Soyuz launcher has an escape rocket which can pull the crewed capsule away from the rest of the rocket for the first 160 seconds of flight included when sitting on the launch pad. This is automatically triggered when if the engines fail or the launcher departs from controlled flight and can also be triggered from the ground. After 160 seconds the crew capsule can still be seperated from the rest of the launcher as happened in this case. The US launchers before the shuttle had similar systems. That's what the shuttle lacked any escape system from launch to glide after reentry. After Challange they got parachutes which could be used if they got to the glide after rentry and for some reason couldn't land.
Most of the inflight explosions of launchers happen when the lauchers departs from controlled flight tearing itself apart or the self destruct is triggered to aviod it leaving the cleared air space.