Not being active enough can cause the Quadriceps, Hamstrings and Calf Muscles to get weak. When those muscles get weak, then the knee joint absorbs more force. These additional forces will cause negative stresses on the knee. As the joint stresses, it breaks down. This can be a cause of early Arthritis. Also, there is more stress on the ligaments, which can cause tears.
Another cause of pain is imbalanced muscles surrounding the knee. For example, the Quadriceps could be overly strong and the Hamstrings are not as strong. This will impose uneven forces to the knee due to the poor muscle balances, ultimately causing early joint break down. Just like if you had a car that was out of alignment, eventually something would wear down and break. Imbalanced muscles can be caused by stagnant lifestyle, poor or lack of warm up/cool down prior to exercise, poor rehabilitation after injury and improper exercise.
Both of these can be some of the many causes of knee pain.