One subset is actually really smart, book smart even, but just doesn't have a personality that aligns with the format of the education system. Those people tend to do really well in a different environment where they have more intrinsic motivation to succeed. For example, I know someone who didn't do well in school even though he had the ability to because he just didn't really see any reward, so he had no motivation. He went into finance and got through uni and his first few job with flying colors, because there was a reward at the end of the tunnel to pursue.
The other subset just doesn't do well with any sort of "bookish" stuff - math, sciences, finance, engineering, etc. just don't really fly. A lot of them I find feel a bit lost because they feel pressure to find a passion or orient themselves around a career when they just don't have anything that sparks an interest. I find that those people tend to do well when they pursue "active" jobs that don't feel like school. A person I know in this category struggled with school throughout his life, but was really good at working with people and interacting on that emotional plane. He went into social services and now works as a crisis counsellor. Most of the "schooling" was basically just situational training, and the job itself is so intuitive to him. Honestly if he didn't have bills to pay I swear he'd do that job for free. Other people in this category are ok with a job just feeling like work, so any high paying trade tends to work well because they can go to work, do their hours, and then enjoy life.