That's a great sequence in the book. S.E. Hinton makes use of the flashback technique in order to tell the reader about Johnny's past experience with the Socs. Ponyboy is at the drive in movies, and he is talking to Cherry. Cherry is an excellent reader of people, and she knows instinctively that Johnny has been hurt bad before and is now very skittish because of it.
"Johnny... he's been hurt bad sometime, hasn't he?" It was more of a statement than a question. "Hurt and scared."
Ponyboy proceeds to explain what happened to Johnny four months ago. He, Steve, and Soda were all walking home from the gas station. Along the way, they found Johnny's jacket on the ground. It had some rust colored stains on it. Then the boys saw Johnny's body laying nearby. He had been beaten to a pulp.
"I thought he might be dead; surely nobody could be beaten like that and live."
It had been a group of 4 Socs that jumped Johnny, beat him senseless, and threatened with all kinds of stuff. Ever since that time, Johnny has been edgier than normal, and he doesn't go anywhere alone anymore. Johnny had never liked the Socs much to begin with, but after that night he vowed to kill anybody who jumped him.
"And Johnny, who was the most law-abiding of us, now carried in his back pocket a six-inch switchblade. He'd use it, too, if he ever got jumped again. They had scared him that much. He would kill the next person who jumped him. Nobody was ever going to beat him like that again. Not over his dead body..."