Can she start just casually chatting to other kids in lessons, trying to build up some new relationships? My dd is 16 and has a large group of friends, but she is always eager to add new people to the group. The key seems to be to find the confidence to be open and friendly and proactive about making the effort to talk to people - much easier said than done, I know, especially if your dd is a bit shy. Is she year 10 or year 11? Might be worth thinking about a change of school in year 12 if that isn't on the cards anyway - a new start with a new group of people?
I struggled with friendships as a teen, mainly because I wasn't very confident, I was really self-conscious and I was really fearful of rejection. I didn't really see what I had to offer or any real reason why others would want to be friends with me, and I wasn't proactive about talking to people, initiating stuff etc because I didn't want to push myself on others and either get rejected or have them suffer me against their will. Truth be told, that is still my default setting now, but I have learnt so much from watching my social butterfly daughter. She is full of confidence and somehow just assumes that people will want to be friends with her. This means that she makes a real effort to talk to them and build relationships, and 99% of the time, they respond really positively. As for the 1%, she doesn't take it personally in the slightest - it's their loss in her mind!
Sometimes, I think you really have to just put yourself out there, but it's very scary if you're not naturally that way inclined.
I think the most important thing you can do now is help to build her confidence and self esteem. It sounds like she is a great kid with strong morals, and not the type to be constantly falling out with others. It sounds obvious but being nice to people is a major plus point when it comes to making friends so she already has lots going for her. So now it's just about helping her to see and believe in what she has to offer as a friend and building her confidence to the extent that she is willing to take a few social risks in order to get talking to different groups of people.
Are there any other kind kids who she likes in whom she could confide? My dd got talking on social media during lockdown to a kid in her year who messaged her because she was feeling really isolated. She wasn't particularly friendly with dd before that so no idea why she picked dd really, but they chatted a lot online and dd eventually persuaded her to build up the confidence to go over and talk to dd's group in school. She now has a brand new group of friends and is really happy.
I hope that she finds the right way forward. It might help her to remember that loads of kids struggle with social issues at that age, and with a multitude of different insecurities, so they will probably be immensely grateful to your dd for taking the initiative!