In order to get an atomic bomb to detonate you need something more than a criticality. You need what's called a supercritical reaction from the U-235 (or Pu-239) to the point where one fission reaction causes more than one subsequent fission reaction. That only happens when you get the materials dense enough and have a neutron emitter than is spitting out oodles of neutrons into the dense hot metal that just got crushed by the explosives. If the explosives are off AT ALL, you wont get the proper shape and density at the time of the explosion and you get a critical but not supercritical reaction which basically works like a bunch of explosives, but not the kiloton yields that a true atomic bomb would get.
The long as the short of it, they tried to make a plutonium atomic bomb but screwed up the design somewhere and got a baby reaction.
There is a section in "Sum of All Fears" by Tom Clancy that goes into wonderful detail (but obviously leaves some stuff out).
And probably puts in some wrong stuff too. I would have.