A lot of people talk about bullying, which is definitely a possible factor, but I don't think adults remember what it was like to be in school. Unless you don't care about it and ignore your future plans, school invades every part of your senses and monopolizes all of your time. Any new information you intake is sized up for difficulty and likelihood that you'll recall it on a rest. If you fall behind one or two weeks on homework and screw up an exam you can end up an entire grade lower. Then there's the constant attention of people who don't really care about you that you're exposed to all day, whose apathy can be just as damaging as their interest.
Online school just wasn't real. Everyone I've talked to said they put in a fraction of the effort required to pass classes online that they did in person, and many people said they had grades practically forgiven.
I didn't have too hard of a time in school but I still remember it as immensely stressful, and for little reason. It is easy for someone with a real problem (drugs, bad relationship, abuse, trauma) to spend a few weeks marinating in cortisol as a result of the panopticon of in-person school to become convinced that suicide is the only way out of their negative feelings.