Students want to get into a school, and schools want certain students. Match. Med students want to get into a specific residency program, and certain programs want specific students. Match.
Tim Harford explains the role of matching algorithms to make picking fair for all parties. The process gets messy when you start looking at thousands of individuals and organizations with multiple preferences each.
The deferred acceptance algorithm is just the start of a successful market design, because details matter. In New York City, there are different application procedures for certain specialised schools. When assigning hospital residencies, the US National Resident Matching Program needed to cope with pairs of romantically attached doctors who wanted two job offers in the same city. These complexities sometimes mean there is no perfect matching algorithm, and the challenge is to find a system that is good enough to work.