Somewhere in the universe there is a place called Gallifrey where ponies mastered the ways of space and time. Long ago these ponies, calling themselves "Time Lords", would travel throughout the universe and beyond, imposing their will upon other creatures. After millions of years or existence, Gallifrey took a stand to not interfere in the workings of the universe and only observe it.
One day a renegade time lord stole a machine called the TARDIS and left Gallifrey to have adventures in the universe. The most favorite destination, and a place closest to a second home, became a place called Equestria. That's the place where the time lord called The Doctor made friends, lived, and died more then once. Thanks to the time lord physiology, she came back to life after receiving mortal damage time and time again. Each time she came back with a different appearance and personality, but inside she is still The Doctor.