Explosives used in ordnance are tested and ranked according to their 'sensitivity' to different kind of external forces. These are mainly external heat sources, direct flames, high velocity impact (ie. gunfire), shock (extreme G forces or hammer like impacts) and sympathetic explosions. To complicate matters further ageing and exposure to moisture or contact with certain metals may turn an otherwise stable explosive into a dangerous to handle substance.
Take for example TNT: it is hard to ignite (it's not even a good fuel for a fire), hot castable and insensitive to shocks (hence its use in shells, displacing ammonium picrate, which is equally insensitive to shocks but more prone to catch fire and deflagrate). Yet a TNT iron bomb directly hit by an explosive shell (i.e. a 30mm ammo) could probably burst as a consequence of the shell explosion working as initiator.
Speaking of initiators and fuzes, sometimes those are the weakest links. Unlike the main payload of a bomb, which is composed of relatively tame explosive compounds (and which are further phlegmatized by the addition of wax, vaseline, rubber and other moisture absorbing agents), fuzes contains explosive which are easier to ignite, that's why bombs are transported (and sometimes loaded onto an aircraft) unprimed. Many a times, a 'high energy event' that would not detonate the main explosive payload of a bomb, resulted nevertheless in a big boom because said bomb was primed and ready to go!