When you crack your back or pop your knuckles, where is the sound coming from?

When you hear clicking, cracking or popping in your joints, what makes the sound?
When a joint cracks, gases (mostly carbon dioxide) that were previously trapped inside the joint capsule rush out. [1] The sound comes from the bubbles popping. [1] If you look at an x-ray after cracking a knuckle, you'll see a gas bubble in the joint. [1] The cracking sound comes from the rapid creation of a vacuum bubble, which collapses very quickly. [2]
The sounds associated with cracking knuckles or joints actually come from the release of gases from the synovial fluid that normally exists in the joint [1, 2, 4]. The gases contain nitrogen, oxygen, and carbon dioxide [1]. When you crack a joint, you stretch the joint capsule, and this causes the gases to be rapidly released [2]. These gases then form bubbles, and in order to crack the same knuckle again, you have to wait until the gases return to the synovial fluid [2]. Ideally, this will happen only a few milliseconds after the initial crack [2]. As you move the joint, the tendon moves slightly out of place, and you may hear a snapping sound as the tendon returns to its original position [2]. Additionally, your ligaments may tighten as you move your joints, causing a cracking sound [2].