Where do a class’s pupils come from?

From the group’s membership. Add or remove pupils under Pupils → Classes & groups; the class list and headcounts follow.