Rin was preparing to summon her soon-to-be servant, which as we know failed miserably... summoning Archer instead... Rin proceeded to have a petty little argument over Archer's disrespectful demeanor towards her, resulting in Rin, using one of the Commanding Seals on Archer, demanding absolute obedience, unexpectedly it worked, but in an instant a strange spell triggered enveloping her and knocked her unconcious... The thing was, Shinji, the stalker and creep he was, had setup a magical trap a few days earlier, rigging it to Rin's entire room, in order for him to capture her and make Rin his perfect plaything, which he accomplished succesfully...
He then used his servant's, Rider's, ability to sabotage Rin's Commanding Seals, triggering nasty effects everytime she would use them, further worsening her situation and tattoing lewd marks all over her body... But he didn't expect was he would also get another, perfectly obedient servant to boot, as Rin's Commanding Seals suprisingly worked, making Archer a perfect puppet whom would watch over Rin, restraining her and punishing her in Shinji's stead, either for disobeing, or just for fun... Shinji in his victorious high even setup an automatic machine, which would smack Rin's ass on random intervals, just as a finishing touch, so she doesn't forget her place...
And so Rin, completely fixed to place by her restraints unable to move or resist, could only weep, moan and beg into her gag, while Shinji could peacefully focus on acquiring The Holy Grail, which he would then use to transform Rin into his perfect slut, bound to him in body and mind...