I can offer some general possibilities as to why someone might behave in such a way:
Selfishness or Lack of Empathy: Your friend may have put her own desires above your feelings and acted without considering the impact it would have on you. This lack of empathy might have led her to encourage you to win your ex back while secretly pursuing him herself.
Insecurity or Competition: Some people might feel threatened by their friends' relationships or successes and might try to undermine them by getting involved with their exes, as a way to compete for attention or prove their worth.
Miscommunication or Misunderstanding: It's possible that your friend didn't realize the full extent of your feelings for your ex or misunderstood the nature of your relationship with him. In such cases, communication issues can lead to unintended hurt and confusion.
Impulse or Lack of Self-Control: Sometimes, people act impulsively without thinking through the consequences of their actions. Your friend might have hooked up with your ex in the heat of the moment without fully considering the implications.
Revenge or Spite: In more extreme cases, a friend might intentionally pursue your ex as a form of revenge or out of spite if there were unresolved conflicts or negative feelings between the two of you.
It's essential to communicate openly and honestly with your friend about how her actions have affected you. Try to approach the conversation calmly and express your feelings without blaming or attacking her. This will allow both of you to gain a better understanding of the situation and potentially find a resolution.
Ultimately, only your friend can provide the true reasons for her actions. If the situation has caused significant distress or damaged your friendship, it may be worth considering whether the friendship is healthy and supportive for you moving forward.