I've been having thinky-thoughts about Eleven's regeneration, and since IronMam and I don't have our blog up yet (it is coming, though!) I'm subjecting you guys to them. (Sort-of-kind-of spoilers for Classic Who? Probably not an issue unless you're adamant about knowing absolutely nothing about a serial before seeing it.)
First note that this is from an entirely in-universe perspective – for the purpose of these musings, Moffat and the quality of the writing are completely irrelevant. Whatever I think of Eleven being the last incarnation of the Doctor's cycle, I'm taking it for granted that he was.
Also note that this is all informed by my own personal canon. Doctor Who doesn't really have an official canon in the conventional sense. It's pretty much up to each individual to accept or reject the widely varying – and often contradictory – information we get from different official Who sources. So if I state something as if it's Whoniverse fact and you don't think it is, that's totally cool.
So, the Doctor has received an entirely new regeneration cycle from Gallifrey, sent through the crack in the fabric of space and time. Thirteen brand new lives. First, the how: regeneration is not a biological trait of Gallifreyans. Like time travel, it's a part of Time Lord technology; something they discovered/developed. The twelve-regen limit is self imposed to curb their power – true immortality would be too much. But it is possible for a Time Lord who has reached the end of their cycle to be given a new one – in The Five Doctors the High Council offers the Master a new regeneration cycle if he helps them. So presumably whoever was Lord or Lady President on the other side of the crack at the time – they would probably be the only one with the authority – chose to do this for the Doctor. But why?
The why is a bit more interesting (and opinion-y). Clara whispers these words through the crack: "If you love him – and you should – help him." And they do. Help him, that is. But there is no way that they did it out of love. This bit is pure speculation, but the fact that the Time Lords are even able to take action from inside the pocket universe Gallifrey is in suggests that they aren't "frozen," like the Doctor said in Day of the Doctor, but that time moves for them in that universe. We saw the High Council's initial reaction to his interference in Day of the Doctor. Yes, he saved them, and they are now reaching out for him, but it's out of self-interest. The Doctor has always been a pain in the ass for the Time Lords (and vice versa). His entire life is a gigantic breach of their laws. He is constantly breaking the rules and flaunting their authority –they've put him on trial for it multiple times. He has helped them, it's true – but the one time he helped them out and the High Council sought to welcome him back to Gallifrey, he ran out on them.
While they're not exactly fond of the Doctor, nor approving of his methods, the High Council has certainly seen fit to use him (and them). In The Three Doctors they themselves broke the First Law of Time to get his incarnations together to save the universe because… everyone else was busy, basically. They've manipulated the Doctor's TARDIS to send him places where they thought his presence could be of use but where they didn't want to involve themselves. They even, in season 6b, "recruited" him to the CIA (Celestial Intervention Agency). The Time Lords have never been averse to using the Doctor to do their dirty work. My guess is that this is exactly what is going on now.