I always assumed the prep-school -> ivy connection was informal, much like the one between certain software companies and cs programs. For instance, Yale takes 10 kids from andover every year because they know all about how smart the 10 smartest kids from andover are from previous experience.
Most of them are informal, but not all. Here are a few situations where an Ivy would offer guaranteed admissions:
1) The university promises admission the top student from the Japanese language program of a certain high school each year. Situations like this often arise from alumni putting crazy earmarks on the donations to their colleges.
2) The university guarantees admission to a certain percentage of state residents each year in exchange for state funding.
3) The university wants to buy more land but the town tries to block the deal because it doesn't want the property taken off the tax roll. The university brokers a deal guaranteeing admission to a certain number of students from the local HS in exchange for the land.
4) A top prep school comes to some more formal agreement with a university for purely strategic reasons.
Situation #1 seems to be the most common in terms of connections to prep schools, although it's hard to say since the relationships aren't exactly published.