It often doesn't - our year 7s are set for Eng/Maths/Sci.
It throws up some anomalies. Usually at English's expense - Maths & Science tend to 'go together' more based on KS2 SATs.
The thinking behind it is:
GCSE courses are blocked first, to allow for option groups & students doing collegiate courses offsite - so core subjects are blocked in so that everything else has to fit round the as far as possible.
That leaves KS3, so year 9 is blocked in next, in subject sets, then year 8.
By the time that's done, the only realistic way to group year 7 is to stream them rather than set them - otherwise you can't allocate staff (& we still end up with split sets, ie. 3 lessons with a subject specialist & 1 with a random colleague who has space on their timetable...)
It's not ideal, but given how dubious KS2 SATs are, it may as well be year 7 where you always have a handful of wrongly setted kids. By year 8 we've got more reliable data to work with to subject-set them.
It's a disadvantage of small to middling schools, I'm afraid.