Maybe it's because Peter is more in tune with the darker side of the supernatural world. Stiles has seen a lot of the harsher realities, and he might feel that Peter's experience and lack of moral restraint in some situations could be an advantage. For example, when it comes to dealing with enemies who don't play by the rules, Peter might be more willing to take extreme measures that Stiles could see as necessary.
One possible reason could be that Peter has a certain allure of mystery. Stiles is a curious character, and Peter's complex past and often ambiguous motives might draw Stiles in. Peter also has a more unorthodox way of dealing with things, which could seem exciting compared to Scott's more straightforward approach.
At first, it might be a tentative alliance. Stiles could be initially drawn to Peter for his knowledge. Peter, seeing Stiles' potential, starts to include him more in his plans. As time goes on, they might develop a mutual understanding. Stiles begins to trust Peter more and more, and Peter starts to value Stiles not just for his help but also as a friend or something more.
One possible reason could be a fundamental disagreement in their goals. Maybe Scott has a new mission that he believes Stiles would be a hindrance to, or perhaps their values have diverged. For example, if Scott becomes more involved with a new group that has a different ideology, he might feel the need to leave Stiles behind to pursue that new path.
It becomes strained. Trust is broken, and Stiles may start to distance himself from Scott. He might not believe in Scott's words or actions anymore, and there will be a lot of tension between them.
In some fanfictions, Scott might betray Stiles by choosing the wrong side in a conflict. For example, if there's a power struggle between different supernatural groups, Scott could side with a group that has intentions harmful to Stiles or his family.
In the fanfiction, it might cause Stiles to question his trust in Scott. Their relationship could become strained as Stiles distances himself from Scott. Scott, on the other hand, would be desperate to regain Stiles' trust. He might go to great lengths, such as seeking advice from other friends or taking on extra risks to prove his loyalty to Stiles.
Perhaps in the fanfiction, Scott falls in love with someone that Stiles also has feelings for. This love triangle situation could turn Stiles' feelings into hatred as he sees Scott as a rival for the person he cares about. Also, if Scott accidentally reveals one of Stiles' secrets that he promised to keep, Stiles would likely be very angry and could start to hate Scott.
Love triangle. This is the most obvious one. Scott is caught between his feelings for Allison and his friendship with Stiles.
Maybe he finds Stiles' character in the original work very interesting and complex, and the fanfiction allows him to explore more about Stiles in different scenarios.
Well, in a lot of these fanfictions, Stiles can get beat up due to his own recklessness. He might be so determined to solve a mystery or help his friends that he doesn't think about the consequences and ends up in a dangerous situation where he is outnumbered and beaten up. Also, there could be miscommunication. Maybe someone thinks he has done something wrong when he actually hasn't, and they take matters into their own hands and beat him up.
There could be other members of Peter's pack such as Derek. Derek often plays an important role in stories related to packs. He might be initially skeptical of Stiles being part of the pack.