She's using external yardsticks, like tests and friends etc as a way to measure her self-worth.
She needs to understand that self-worth doesn't come from measuring yourself against other people. You inherently have self-worth if you believe that we are all equal, which we are
Ask her, how does a disabled person compare herself to your DD?
Does she think the disabled girl, same age as your teen, in a wheelchair, who might be mentally disabled, is worth nothing?
That that person should 'give up' because she'll never have friends, she'll never have a job?
We all have a right to be on this planet, whether we achieve lots or very little at all.
Society will try and tell you you're a failure but it's not the case. We all have to try with what we've got from where we are, otherwise, what is the alternative? Fall into the abyss? The pool of self-pity?
Also, some people thrive in school but don't do well in the real world.
You really need to educate yourself with much better answers to her questions so as to help her validate herself and her experiences differently. Read some Brene Brown, understand perhaps more about neurodiversity - the voice in your head is a killer - look up Spectrumy on Facebook. Find role models who have done badly at school, like Steven Bartlett, who made nothing of himself at school due to ADHD but now has a huge YouTube channel - and maybe watch some of this content on adversity and how to overcome it. There's a ton of self-help material you can find to literally rewire your brain. Look up Lewis Howes.
We are all born with a different set of 'ingredients'. It's not her battle to try and attain something she wasn't born with, it's her battle to have the courage to live her life with what she's been given and make the best of what she's got.
Right now she sounds a bit victimy. It's a sort of unconsious self-sabotage that's common in people, especially young people. "I'll never succeed because of X".
If you give up, you've already failed. If you keep trying - you have a chance to win. so don't give up.
Blaming others it just an excuse not to try if you're truly honest with yourself.
Look up Jack Ma and see how many times he failed to get into Harvard. There are so many stories of resilience and eventual success. Find them. Ask ChatGPT if necessary. She needs to change her mindset. She can have a good future. School isn't everything, nor are fake friends...
Good luck.