I'm not so sure about this question but,I think you must go to Wikipedia or Touhou Wiki to find more about this question.
In My opinon according to the wiki she is friend of Remilla's but also is a Teacher/Scholar, It's possible that she teaches Remilla. The latter I've seen more used in fancomics. Officaly? I don't think it's ever mentioned. You might want to Check Bohemian Archive / Perfect memento, in case it's mentioned there.
There's no official reason given besides "the two are friends." Remilia finds it useful to have a magician around, whereas Patchy gets all that mansion space for her personal library, so it's a good working arrangement between the two.
Maybe Remilia want her to look for Flandre prison. Patchouli must refused because she do not want to leave her library, then Remilia brought it to scarlet mansion. My opinion through (sorry if have errors, because english is not my first language)
I can't remember the source of this, but I remember reading something that would explain this: it's because of what made them befriend each other to begin with. Basically Remilia went and asked Patchy to move SDM to Gensokyo. Patchy don't want to do it, so they had a big fight in Patchy's house. The entire house got demolished by the fight, but they became good friends in the process. Since Patchy's house went down, Remilia invited Patchy to live with her.