It sounds like you are being a little overwhelmed by all the REASONS for this. You should simplify it. The problem isn't that she's mature, it's that she's choosing to be bossy. Not all smart, advanced, mature people are bossy. Tell her not to use her god given gifts as an excuse to be mean.
Tell her siblings that being smart has nothing to do with it, so to quit enforcing that belief. They're encouraging her to justify her superiority in her mind with hat reaction. Anyway, she's SAYING she's mad because everyone is so much dumber than her, but really, at this age, with older peers, it's insecurity. Many kids this age are insecure, and you say kids were mean to her in the past.
Also, her being "like and only child" has nothing to do with it either, again, many only children do not do this. If you think her getting a lot of stuff is hurting her behavior, then don't let her get so much stuff, but she can learn manners and how to be gracious if she has to. BUT if you mean she's acting spoiled and ungrateful for stuff, you should definitely give her stuff to people who need it as a consequence to any brattiness of that nature.
Ok, she's 7, so she's a little old for constant discipline about manners, and you say this behavior is new. She's young and approaching the difficult years. Sounds like her foundation is good if she just started this. This is probably a phase that will only last until the message sinks in that it's not OK. That's not to say, "sit back and let it pass", that's just saying that with work it can pass and she won't become a hideous cheerleader like in Mean Girls or something when she's older.
My daughter has learned some SUPER bratty tones in daycare (an upscale one), but she's 4, so I can keep a constant check on her. At the last few birthday parties I was BLOWN AWAY by how the other kids are allowed to talk to their parents and each other. THE TONES!!!! Out of 4-5 YEAR OLDS! And the moms just ignoring it and smiling, like, "I don't know how they got this way.." and the other moms being like, 'I know, mine too, chuckle chuckle.." I can't blame my daughter for trying it. One girl told her mom to "shut up and stop bothering her." My daughter looked at me and looked at her(still in a daze-I thought I was in outer space!) and did the discrete "no" nod, like she wanted reassurance form me that this wasn't OK when she saw it. I feel bad sometimes like I'm the only one who doesn't allow it. But we went to a scrappy school when I was young, and my parents never allowed disrespect and we were disciplined for bad things no matter where we learned them, and by elementary school, we would have never dreamed of being mean. Be diligent. Give her consequences when she's mean. Does she smart off to you? It's not easy to let her smart off to some people and not others, you need to make sure she knows it is ALWAYS wrong. What's the most meaningful to her? Take it away and make her earn it back with x amount of weeks being rude to NO ONE.
Also, give her some new fun privileges and responsibilities when the waters are calm for contrast so she feels valued and happy. Make it a huge black and white difference between her life when she chooses to be nice and her life when she chooses to be mean.
You say she is very respectful and kind to adults. Does this mean YOU TOO??!!! This is where you CAN teach her what is not tolerable behavior for her own good. You know she CAN control herself and make the right choices if she's already nice to adults. You need to give her the positive messages about how important it is to be a good, kind and respectful to EVERYONE, and you also need to enforce discipline when you personally see her acting mean to you or anyone else. Or even talking rudely ABOUT someone. Remind her she is being mean in spirit and words and it's not allowed. She needs to know that people do not hate smart people, they hate mean people.
Maybe you can stage a sort of make-up play date with the best friend. talk it over with her mom. Get creative.
If she was treated badly in the past, then she knows how it feels. You have to enforce her behavior. When you hear people have been mean, or don't want to come over and it's because of how she was acting, don't sympathize TOO much. Hear her out, tell her you're sorry that hurtful thing happened, but remind her that this will all blow over and people will forget they were mad once they see how NICE she is. But if she isn't nice, she'll never be liked. And if she acts cocky and like she's too good for everyone, she may end up getting decked one day by someone bigger than her. The cute boys won't like her, etc. Just be open and honest. It's all true. She's scared and trying to learn the ropes like we all did. Don't feel bad that it's all on you, you're a great mom, you've raised 3 already, and you can do it.