In Battle Tree and Maison, there's a set of trainers that can appear in the first 10 battles (actually for Tree that's the first 9 battles, since every multiple of 10 draws from a "Famous Trainer" list instead of the normal list). After that, if you get to 11, they rotate some of the trainers off the list and bring in new ones, with what are generally perceived as harder movesets, and you roll from that list up to 19-20. At 21 there's another change-off, where all the remaining trainers who were still in the rotation from the first 10 get scrubbed from the list, and another new selection joins in. Likewise for 31. **In Maison, the last change to the list happens with battle 41**, and that's the point where some of the trainers being introduced will have legendary trios and such on their teams (discounting the Chatelaine herself for battle #50 in particular). Tree also uses 41 as the point to start adding trainers with legendary rosters, but **in Tree there's also one more rotation at 51**, right after you beat the Battle Legend. In fact, no one gets knocked off the list at 51, but a wide variety of trainers are added, including several more with "legendary spam" teams, so at that point you have to be ready to cope with all kinds of different team strategies.
https://bulbapedia.bulbagarden.net/wiki/List_of_Battle_Maison_Trainers#Super_Course_Trainers
https://bulbapedia.bulbagarden.net/wiki/List_of_Battle_Tree_Trainers#Battle_Tree_and_Battle_Agency_Trainers