In the squat, extension occurs in the knee joint during the ascent (up phase). In this action, the thigh moves away from the shin as the leg straightens. The major muscle involved is the quadriceps femoris group.
In the hip joint, extension occurs as the thigh moves up and forward to be in line with the upper body. The major muscles involved in this action are the gluteus maximus and the hamstring muscle group. The ankle joint is also involved, but it is mostly passive. The erector spinae muscles contract isometrically to stabilize the spine.