To understand what happens when you crack your knuckles, I think it is important to first have a general idea of the anatomy of a knuckle. A knuckle is the joint (meeting place) between two bones in your hand and/or finger. Each knuckle is surrounded by a joint capsule (tissue that wraps around the joint) and held together by various ligaments (bands of connective tissue). The ends of the bones in the knuckle are in very close proximity to each other, with a small space between them called the joint space. This space is filled with a very slippery fluid called synovial fluid.
At first, when you pull on your finger, the viscous adhesion, or tension between the two bones, resists their separation. Once enough force is applied to your finger to overcome the adhesion or tension, there is a rapid increase in the size of joint space and a gas bubble forms in the joint space. The noise associated with cracking your knuckles is produced at the same time as the gas bubble forms. Once you let go of your finger, the gas bubble is reabsorbed by the fluid in the joint.
Have a look at the video below to see it happen in real time. Notice that as the finger is first being pulled on, there is very little change in the size of the joint space (the dark line between the two whiter and brighter bones). As the pulling force continues to increase, there is a sudden and quick increase in the size of the joint space and a black line, which indicates the formation of the gas bubble, suddenly appears. Although you cannot hear it on the video, the cracking noise occurs at the same time as the black line appears.
As an aside, there is no evidence to suggest that cracking your knuckles can give you arthritis. A study published in 2011 looked at the prevalence of osteoarthritis in the knuckles of those who cracked their fingers versus those who didn’t. What they found was that people who cracked their knuckles were no more likely to get arthritis in their hands than those who didn’t crack their knuckles, regardless of how long the knuckle crackers had been cracking their knuckles.