The knee serves as the "hinge" for the leg. By being able to bend, rotate, twist, straighten, push and pull, the knee joint provides the leg muscles with more torque and overall strength, as well as much more flexibility. When a person squats, the knee is bent to its full capacity as the weight of the body lowers to center behind the knee joints. The quadriceps muscles and all the attaching ligaments and tendons stretch to accommodate the change in balance, and the knee cap locks in place over the bent leg bones.
The effects of injury to the knee can cause all kinds of problems with the squatting action. Swelling, which is the first reaction to an injury, will inflame the knee joint, essentially thickening and freezing it, making it almost impossible to bend. The sense of "tightness" will make bending the knee painful, and there is likely to be a sense of weakness as well. In the case of torn ligaments or loose bodies within the knee joint, the knee can either "collapse" and not hold weight, or it can "freeze" and lock into position. Both of these situations make squatting impossible.
There are several different types of knee injury. Acute knee injuries, like broken bones or dislocations, make using the knee impossible and must be dealt with, medically, right away. Chronic knee injuries, such as strained tendons, cartilage problems, or osteoarthritis, can cause problems with knee functions, and make squatting painful and difficult. Overuse injuries will respond to rest and often a full recovery is possible. Depending on what type of injury the knee has, squatting may or may not be an acceptable action after treatment of the injury.
It is important to understand that if you force your knee to work when it is injured, you are likely to exacerbate the injury and cause more harm. Quite a few knee problems can be worked through, and the knee made to function even when there is significant damage. This is particularly true in the cases of cartilage tears. If the knee feels like it is unstable, or if there is sharp or shooting pains around the knee, it is important to get off it immediately and seek medical attention.
If you are experiencing knee pain, whether it is sharp or dull, it is important to reconsider any activity that might stress the knee or increase the discomfort. The best advice is if it hurts when you do it, don't do it. If your knees hurt when you squat, make a point not to do it, or do it as little as possible. If you know the cause, such as obesity or old injury, then chances are you do not need to seek additional medical attention. But if your problem is new or intensifies, it is time to seek help.