Wall sits are a knee-friendly exercise as the knees are held in a fixed position, so there is less force being placed on the joint than in a dynamic exercise like the squat.
Wall sits also help to strengthen the quads and hamstrings. These muscles stabilise and support the knee, so strengthening them can help improve knee pain.