They had a falling out, the anime elaborates on it, Once Leon won the championship Sonya started feeling distant from him, I mean he's' the skilled unbeatable Leon and she's just some useless kid with only 1 pokemon, no badges and no real drive to better herself since Leon surpassed her so quickly. By the time she meets you and Hop she's basically living the NEET life, her grandmother got fed up and tossed her out on her bum she did, after a dressing down about how she's wasting her life while two 10 year olds are trying to make the best of theiers. Of course, over the course of the game as Sonya discovers her passion for pokemon reasearch and exploration she start approaching and talking to Leon more accumulating in her running fafter him to take care of the Dynamax'd Pokemon.
Finally after Rose's arrest comes the Zacian and Zamamata incident and later the Crown Tundra incident and as such she ends the game as a accomplished young author and pokemon researcher
This is probably coming like this because of how in gen 7 and gen 6 you utterly crush Hop and Serena's dreams to dust and they kinda end the game just off to the sidelines completely in awe of you and down on themselves, Hau despite getting smacked again and again will not give up, Serena gies up just like May before her with no indication of what else they're gonna do with their lives