Johnny and Pony defend Dally because they are friends and from the same neighborhood, and Cherry is a Soc.
Cherry is a cheerleader from Pony’s school, but they do not travel in the same circles. Cherry is a Soc, and Pony is a greaser. This means that they are from such vastly different socioeconomic backgrounds that they would never normally fraternize. Yet despite this, Cherry is nice to Johnny and Pony. She dislikes Dally because of his behavior, not because he is a greaser.
When Cherry calls Dally “trash,” Pony immediately stands up for him, backing him up along neighborhood lines.
I felt myself stiffen. "I'm a grease, same as Dally. He's my buddy." (Ch. 2)
Cherry apologizes, and proves to Pony that she doesn’t harbor resentment toward all greasers by asking him about his brother and telling him that Soda is a “doll.” She makes it clear that Dallas disgusts her because of the way he treats her, not because he is poor. He is crude and boorish, and she will not tolerate that.
Pony and Johnny have to defend Dallas because it is part of being a greaser. Greasers stick together, and stick up for each other. They need protection against the Socs. This is a different situation, though, and Johnny breaks the code to protect Cherry from Dally.
When Dally gives the girls Cokes, he is still leering at them, suggesting that it might cool Cherry off.
She gave him an incredulous look; and then she threw her Coke in his face. "That might cool you off, greaser. After you wash your mouth and learn to talk and act decent, I might cool off, too." (Ch. 2)
Dally describes Cherry as “fiery,” and that's when Johnny bravely intervenes, telling him to back off. Dally does leave, spoiling for a fight elsewhere. Cherry thanks Johnny and she talks to the two of them like they are normal, nice boys. She even thinks that Two-bit is all right.
Johnny and Pony are out of their element and they know it. When Pony and Cherry are standing in line for concessions, other Socs stare at them. Ultimately, though, Cherry believes that she and Pony are more alike than they are different. She tells them that things are rough all over, and Pony realizes that they see the same sunsets. This is a metaphor for the fact that although they live in different neighborhoods, they are all just people deep down. There are good people and bad people in both gangs.