Well, that’s a tougher one to answer than “how does someone stay documented” but an easier one to achieve.
Overstaying a visa, knowingly or unknowingly. Losing your job when you are on an F-1. Divorcing your spouse when you are a dependent. Losing an asylum decision. Dropping out of school while you are on an F-1. Being exploited as domestic help by your employer. Getting placed in deportation proceedings for some minor crime you committed and served time for years ago. And the list continues.