Since Sakura and Rin met face to face during the early eps, there's always been some tension between them. There have been uncomfortable "Sakura..." and "Tohsaka-san" exchanges between the two of them in the past, and Sakura became extrememly pushy and sensitive when Rin moved in with Shirou. We all assumed that this was because it looked like Rin was getting close to Shirou, who Sakura is quite fond of, but it may in fact been that she was curious of Rin's presense alone, rather than any connection between Rin and Shirou.
If you watch the series over and look for their interactions, the grounding is there. We're supposed to believe that Sakura and Rin are only upset about the closeness of the other one to Shirou, but it turns out the two of them had a past of their own.
All of it was supposed to be ambiguious, to keep us from guessing the two of them knew each other on their own, with Shirou playing almost no role in the past the two had together.