All Americian launches have a Flight Termination System (FTS) which is a bomb attached to ensure the off-course vehicle explodes before returning to earth. There are personnel in the control room who can activate the FTS when something goes wrong and there is a danger to people on the ground.
That is what detonated the StarShip today.
You'll find it was notably absent in Soviet rocket tests, for instance with the N1 which veered off course, returned to the ground intact and exploded there instead.
There's something called FTS. Said fireworks were responsible for todays RUD... ;-)