Well, 3 years (at best) to find an employer who will sponsor you for an H-1B visa application. And then you have win the once-a-year lottery to get the actual H-1B visa (~1/3 chance this year). And then you hope that your employer will agree to apply for a Green Card on your behalf right away (which they don't have to; they can keep you on the short leash of H-1B for another six years). The processing of the Green Card application can also take a few years. And if you change jobs while your Green Card application is in process, it's voided -- you have to have your new employer re-apply from scratch. And if, at any point during all of these, your current status (OPT or H-1B) expires, you have to pack up and GTFO of the country.
A non-zero amount of people never get the chance to obtain an immigrant or dual-intent visa during those years and subsequently get kicked out of the country.