When do you see and hear this snap? It may be there’s a thickened rim of meniscus. As the femur (thigh bone) slides and glides over the tibia (lower leg bone) where the knee forms the round surface of the femur moves across this rim making a noise such as a click or snap.
Sometimes this piece or flap of tissue is torn and gets pushed away from the bone. Other times it’s being pushed back in place. Either direction can cause a sound like you describe. There may not be anything you can do about it now but it should be watched. An X-ray or MRI may be needed.
Over time there’s a danger that trauma from a sports injury or athletic event can cause a tear of this area. In some cases repeated smaller motions (microtrauma) causes the rim to tear.