There are several things in play. It's been an evolution going back to the days when students were directed to the "school photographer" for senior portraits. As mentioned, the photographer would provide, free of charge, all additional photos for yearbook publication: team photos, group photos, usually coverage of one of each event... football game, basketball game, etc. This grew into also providing camera gear with film and processing for student photographers, including instruction. Often, the school received a "commission" or "discount" at the end, as "kick-backs" were not acceptable.
In exchange, the school would provide the names and contact info for the seniors, sometimes helping in scheduling the sessions. The seniors were charged for the sessions. The studio also got the work to do the underclassmen.
Gradually, the argument that the school has no right to dictate where students spend their own money took hold, and seniors sought new, better sources for thier portraits. This presented a new concern. Just as other teams and clubs compete, the yearbook staff would submit thier book into competition. One of the criteria to score well (at least back then) was consistency in the senior portrait section. So the yearbook staff developed a set of specifications for submitted photos.... background color, head size, and such.
Some students began to submit photos at the last minute, just before the publisher's deadline, that did not meet the specs. Not wanting to exclude photos and still wanting to achieve a uniform look in the yearbook, the schools began to provide the seniors with a list of photographers that promised to provide portraits that would meet the specs and deadline.
Today, some schools strictly enforce this. But many, if not most, have softened or abandoned the effort.
-Pete