Dr. Sparkle and Dr. Spike are 2 employees with rather out of the ordinary jobs.
They are able to stimulate the minds of ponies and allow them to relive their lives all the way from the very beginning, with the goal of reaching a goal or fulfilling a wish, though only in the minds of their patients. Due to the severity of the operation, the new life becomes the last thing the patients remember before drawing their last breath.
As such, the operation is only performed on ponies on their deathbeds, to fulfill a desire, to satisfy what they wish they had done with the time in their lives, but failed to do.
As the two doctors delve into the memories of one patient, Rainbow Dash, they step further and further back through her lifespan, all the way back to the start. Through their combined efforts and difficult work, Twilight and Spike attempt to grant the dying wish of Rainbow Dash, and perhaps discover, somewhere along the way, why she chose the wish she had.
And Rainbow Dash's last wish is, of course... to fly to the moon.
(Credit to Galaxyart for his amazing artwork and ponified trailer of "To the Moon," by Freebird Games, which inspired me to write this story. If you haven't watched Galaxy's trailer, stop being crazy and go check it out.)