Locking of knee joint occurs due to -
During last stages of extension, femur rotates medially on tibia due to quadriceps femoris to lock the knee joint.
Lateral rotation of femur during last degrees of extension.
Medial rotation of femur during last degrees of extension
Lateral rotation of femur during last degrees of flexion
Medial rotation of femur during last degrees of flexion