Tohsaka Rin's magical form due to her Kaleidostick Ruby.
The Kaleidostick, Ruby, is a sentient wand that hates its creator Kishua Zelretch Schweinorg. It is capable of forming a contract with its wielder, allowing it to use an ability known as Prism Trance to "download" and transfer knowledge from an alternate version of its user into its current wielder. It also provides an ample amount of prana, but it also likes to manipulates its wielder into humiliating situations.
In Fate/hollow ataraxia, the Kaleidostick is responsible for transforming Rin into the magical girl Kaleido Ruby.
Her role in 'Fate/kaleid liner PRISMA☆ILLYA'
Again, Rin uses her Kaleidostick to transform in Kaleido Ruby until Ruby cancels their contract and makes a new one with Illya.