My son was like a bit this: on the surface all brash confidence, and underneath insecure, bored, then disruptive and eventually disengaged.
'Respect' was a big theme for him, too. He said, frequently, "If teachers are alright with me, I'm alright with them". He couldn't get his head round the fact that a basic level of respect was expected from him - and rightly so - even towards teachers whom he deemed 'unfair' or 'nasty'. By year 9, I could clearly predict which teachers he was going to have problems with (and vice versa)... Passionate committed teachers tended to like him, because he'd give them as much passion and commitment as they gave him. But equally, he'd be sarcastic with sarcastic teachers, bored with boring ones, and rude to any who were rude to him.
At first I backed up school, and if my DS was in trouble at school, he was also in trouble at home. But there were some awful incidents when my son was badly hurt/bullied, and school let him down terribly, and I felt I needed to support and 'champion' him. Through years 7 and 8, I often felt like a mediator, trying to get different 'sides' to understand each other. 
As a parent, I was slow catching on to the fact that schools are primarily interested in the collective well-being of groups. If your child is disruptive or otherwise interfering with 'group' well-being and learning, then s/he will be in trouble.
I stopped getting so involved around year 9. I told my son I could see he was behaving badly, and that since he knew the rules by then, I didn't feel I could 'fight his battles' if he wasn't going to abide by them. I told him that, although I agreed some rules and some teachers were 'unfair', that was life. If he wanted an easy time at school, he knew what to do. If he wanted to rebel, he would have to take the consequences. I did still get involved, but only as a last resort, not a first.
With hindsight, I think I would have given my son different messages and strategies. He did have a hard time at school, but rather than trying to mediate and 'fix' things, if I had my time again I think I would be more pragmatic, and tell him "Yes, school is hard work for lots of kids. Your challenge is to find a way of getting along and learning as much as possible. Now, how can I help you do that?"
And funnily enough, my son knew he was being a pain. Just last week - more than three years after leaving school - he said to his little bro "God, I was such a dick at school!"
Wide, I bet your DD knows she's being a pain, too. But she doesn't know how not to be, and she wants you on her side when she gets into trouble.
Probably the best things you can do for her at this stage are:
- Acknowledge school is tough for her
- Help her think about what she's doing in class that's annoying people and/getting her into trouble - and make a sort of 'checklist' of her behaviour and warning signs.
- Help her work out some strategies for changing what she's doing, eg "When I notice myself wanting to chat, I'm going to hold my breath for a count of ten and re-read the question"...
- Help her work out some 'treats', 'rewards' and 'outlets' for herself, for when she's controlled herself and/or successfully avoided trouble! Eg: I didn't talk to my friend in class today so I'll phone her now!
Good luck!