I don't know the exact cause of cracking joints and as that page indicates professional opinion is also inconclusive, but I've always thought it was the cavitation of the synovial fluid which is again confirmed there.
From Johns Hopkins' Orthopedic page:
Cracking and popping of joints is usually normal and most of the time
is nothing to be concerned about. Strangely enough the exact reason
joints pop and snap is not totally understood. One theory is that the
ligaments (tethers that hold the bones together) make these noises as
they get tight rapidly when the joint is moving. In some instances,
popping may be due to a tendon snapping over or around the joint.
Another theory is that nitrogen bubbles in the fluid inside the joint
are rapidly brought into or out of solution when the joint is
manipulated, such as cracking the knuckles in the hand. These noises
with movement of a joint, particularly the knee, may sound like
folding stiff paper, and are called "crepitus". These noises are
increased frequently after surgery on a joint, although the exact
reason is not clear.
From personal experience I found that the crackling and popping is most intense when I have a lot of muscle tightness and I haven't stretched in a long time. I also notice being sedentary or immobile for long periods of times aggravates it further.
My personal approach to reducing joint pain and crackling sounds is by foam rolling, stretching and doing dynamic stretching (mobility). I would spend a lot of time improving my flexibility and make sure the joints are fully warmed up.
To improve range of motion you can do:
Finally, even though stretching/foam rolling etc can be helpful, if done incorrectly or too aggressively it can be injuries. So make sure to take your time and ramp up slowly. If you feel like you have chronic or acute symptoms then you should definitely see a sports doctor.
Edit:
Here's another source from StrongLifts.com echoing what I said about soft tissue work.
One thing that seems to diminish the cracking is soft tissue work.
Some say the cracking/popping joints is evidence of trigger points
causing joint stress. You can eliminate those trigger points yourself
with a foam roller. For cracking knees I recommend foam rolling your
calves, but also your IT band etc.
Finally, here's a warm up guide I wrote a while ago, which includes foam rolling, static and dynamic stretching.