>>14829540>Barry's an overly-confident kid who gets his shit WRECKED the first time it really means something and decides he wants to get stronger for himself.Same for Serena.
Look at it this way, She's the daughter of two Veterans who taught her plenty of things about Pokemon, Was the aloof yet polite leader of the Kalos gang, and was the most skilled trainer.
Then you come and she doesn't exactly register you as a true rival in the beginning with her running off to do her own thing. Yeah, she help out against Team Flare, but she was in the area doing the right thing like you and not actively hunting them down.
And then comes the Tower of Mystery and her 1st defeat towards you. She starts to see you as a obstacle towards being the best trainer and apply herself more than usual. She gets sadden with each loss, but not enough to be depressed and push herself harder. In the end, she calls you a great friend and rival and wants to keep on battling you as friendly rivals. That's her character development.
She even gets her own Mega Ring in the Post-game.