I’ve heard it explained a few different ways but here is the best way I know to break it down. Before the admissions cycle even begins, the admissions office is told how much revenue they need to generate and how much aid they can hand out. It is expressed as a total and in other ways such as per student. For example “we need 40% of students full pay to be able to achieve an average of 50% discount for everyone else.”
The path may vary by school to reach those thresholds but the numbers act as a governor. The enrollment management systems they use include a financial component so a running total can be tracked actually. So some schools might use ED to fill up the full pay slots since many ED families waive aid. Or it might be by geography and family details, as the schools definitely have not only the fafsa materials but also have a detailed history of families by high school, household zip and other information easily obtained and used to build a model. For example, school X knows that if a family in Bethesda is offered $10,000 discount they accept 84% of the time.
Strong recommend here to learn more, detailed explanation for one school including the human side.
https://www.nytimes.com/interactive/2019/09/10/magazine/college-admissions-paul-tough.html