One of the big problem with rockets is that most of them are only flown once.
Which means that any manufacturing defect will only be found out on launch, by which point it’s hurtling skyward and will either reach orbit, or fail.
It’s no coincidence that the most reliable rocket in history, the Falcon 9 Full Thrust, is also the only one that’s been meaningfully reused. SpaceX haven’t actually built that many of them, they just fly them a dozen times each. Plus, because they get many flights out of each first stage, they can spend more on building each one, and therefore it’s economical to perform a more thorough inspection.
When cars or aeroplanes are built, they are taken for short test drives or test flights. This allows faults to be diagnosed in a safe environment. If this didn’t happen, those vehicles would be a lot less reliable (which sometimes happens when this step is skipped, for example in wartime).
As for exploding vs other faults (like just crashing), rockets are fitted with flight termination systems, so they don’t crash while intact and level an entire neighbourhood. So any major fault, and the rocket is blown up.
Latest Answers