When you are in a seated position the patella (Knee cap) acts as a fulcrum. Your quadriceps attach to it.
In some people, the patella will slide laterally excessively and cause a kind of 'lock up' pain/click. See and orthopod for a good exam. There is a simple surgery to correct the problem.