Fat Man and Little Boy were armed by people crawling over them in the bomb bay to do various things (including inserting fuses iirc).
More modern bombs were/are armed electronically by the weapon engineer or bombardier.
In the crash cases the regular explosive in the bombs went off in a few cases, but because the bombs weren't armed all it did was scatter casing and nuclear material over a wide area, rather than nuking the east coast of the USA or Southern Spain or a bit of ocean etc.
The one in Spain was a bit of an embarrassment, as the US had to pay to resettle people and haul away millions of tons of topsoil for burial in the US.