Slate‘s ever-useful Explainer column provides the details:
The "quadrant" system. As many as six trailers play before features at major chains, like AMC and Regal. The studio releasing a given film typically has automatic rights to two of these slots, and theater executives (in consultation with higher-ups from various studios) select the remaining four. Though theoretically studios and theaters could attach any trailer to any movie, they usually decide which releases to promote by using the "quadrant" system, which divides potential audiences into four different categories: men under 25, women under 25, men over 25, and women over 25.
The piece provides some nice details on how the quadrant system works and exceptions to it. Plus, there’s some good bits about the time a studio paid $100,000 to encourage theatres to show trailers for a Rob Schneider vehicle, and also a link to this in-depth story about the politics and shenanigans (who knew?) behind getting trailers placed in front of big ticket movies.