Cracking can occur for different reasons.
Bones can rub against each other, common with the kneecap rubbing the knee. Cracking knuckles are different. These occur because with the attempt to crack the knuckles, one pulls the fluid in the joint (almost all joints have fluid - usually a small amount) and the fluid is pressurized to a liquid gas which make the cracking noise. Tendon can rub.