To understand what happens when you "crack" your knuckles, or any other joint, first you need a little background about the nature of the joints of the body. The type of joints that you can most easily "pop" or "crack" is the diarthrodial joints. These are your most typical joints. They consist of two bones that contact each other at their cartilage surfaces; the cartilage surfaces are surrounded by a joint capsule. Inside the joint capsule is a lubricant, known as synovial fluid, which also serves as a source of nutrients for the cells that maintain the joint cartilage. Besides, the synovial fluid contains dissolved gases, including oxygen, nitrogen and carbon dioxide.
The easiest joints to pop are the ones in your fingers (the interphalangeal and the metacarpophalangeal joints). As the joint capsule stretches, its expansion is limited by several factors. When small forces are applied to the joint, one factor that limits the motion is the volume of the joint. That volume is set by the amount of synovial fluid contained in the joint. The synovial fluid cannot expand unless the pressure inside the capsule drops to a point at which the dissolved gases can escape the solution; when the gases come out of solution, they increase the volume and hence the mobility of the joint.
The cracking or popping sound is thought to be caused by the gases rapidly coming out of solution, allowing the capsule to stretch a little further. The stretching of the joint is soon thereafter limited by the length of the capsule.
But how can release such a small quantity of gas cause so much noise? There is no good answer to this question. Researchers have estimated the energy levels of the sound by using accelerometers to measure the vibrations caused during joint popping.