A great place to begin to understand the physics of nuclear weapons is with Einstein's most famous equation: E = m*c*c. This equation associates energy E with mass m. The constant of proportionality is the square of the speed of light c. Because c is rather large (3E8m/s), the equation suggests there is a lot of energy associated with even a small amount of matter. In fact one kilogram of matter contains 9E16 Joules of energy, which is roughly the amount of energy released by a hydrogen bomb. Chemical reactions, such as the combustion of petrol in car engines, free less than a billionth of the energy stored in the mass of the fuel, since they do not involve the atomic nuclei, where most of the mass is stored. However, in nuclear reactions the trick of releasing a large proportion of the bound up energy becomes possible.
Two kinds of nuclear reaction may be used to release energy on a large scale. Fission is the splitting of heavy atomic nuclei into pairs of lighter nuclei, while fusion is the marriage of two light nuclei to form the nucleus of a heavier atom. When (protons and neutrons) come together to form an atomic nucleus, the nucleus is found to weigh less than the sum of the masses of the nucleons. The difference is the mass of the energy released when the nucleons combine (the so-called "binding energy"). It turns out that the binding energy per nucleon, which is also known as the "mass defect", varies for different sizes of nuclei. If on average more than one of these product neutrons goes on to cause a further fission, then successive generations of fissions involve exponentially increasing numbers of atoms in a nuclear chain reaction.
Nuclear weapons are in themselves morally neutral: they can be used to do good as well as evil, for instance, by destroying or deflecting an asteroid, which threatens to collide with the Earth. However, in the hands of irresponsible people nuclear weapons present a great threat to the future well being of the world.