I don't believe a formal answer was ever provided in the movie, but it seemed to require Phil to finally diverge from a path of pure selfishness and embrace the ideals of love and respect for other human beings. He started the movie disrespecting the cameraman Larry (Chris Elliott) and the producer Rita (Andi MacDowell) by blowing off the ceremony by being late, providing poor commentary, and acting generally boorish to everybody including town officials, the landlady, and former acquaintances like Ned. He needed to see his disrespect of them through many incarnations of the day and change his attitude. Only when his attitude was proved to be changed by his love of Rita, was he able to escape the time loop.
According to this review answering such questions in the movie itself would have "ruined" it. The original script contained an explanation of the start of the time loop - a voodoo spell - but that was considered a poor idea.
So, I wonder if there is a conclusive answer to your question. It was deliberately left out by Harold Ramis. We are left speculating about it (maybe even encouraged to do so) and I think that is one of the reasons why this movie has had so much impact.
It's a very very hidden big irony.
He started the movie as a jerk and egotist, with everything in his mind being about him and not caring about others. At least, on a minor, 1-person scale. We are led to believe that this perception of things being about him are wrong.
Then, as we find out after the movie ends (see wbogacz's excellent answer), the whole universe was frozen in thousands of days of a loop, all for the express purpose of providing a lesson to Phil that his initial worldview is wrong.
Except, in the end, it is all about Phil. The only mistake in the beginning that he made was the scale - the whole UNIVERSE is about him, not just an individual personal bubble of things around him.
If you take the movie as allegory this question — and the movie — become sublime.
While I like wbogacz's and DVK's answers very much, I humbly suggest they are incomplete. It's about more than overcoming selfishness or solipsism (all about me) or even insufficient solipsism, as keen an insight as that is. For me the answer to the original question comes when the movie is taken as allegorical, an analogy for one of life's deepest lessons.
When today is invested in tomorrow, only that breaks the monotonous cycle of days.
Yes selflessness is a part of that. So is empathy as an antidote to solipsism. But neither explain the piano lessons. Those represent pure and simple investment today into a better tomorrow, and so form a part of the escape from each new day being no better — being indistinguishable — from the last.
I know little of Buddhism (and half of that from just now reading Wikipedia) but the lesson reminds me of the Buddhist concept of liberating oneself from the endless cycle of suffering and rebirth. I wonder if reincarnation was originally an analogy for the same concept: to invest in today for a better tomorrow is to attain greatness.
It was a miracle of God intervening in his life.
For whatever reason, he was permitted to experience reality over and over and over again, while fully cognizant and fully remembering everything prior.
It's like conscious reincarnation, each day being a new life, only with him starting out as a 45 yro instead of an infant.
After thousands of days, he had successfully traversed from
In this sense, the movie is a clear indication of the cycle of Reincarnation, albeit one where this individual did not have to be reset continuously inorder to progress.
The ending is him literally breaking out of Maya (illusion), as the Hindus say, and leading a wholly Activated, Enlightened existence, without the need of further reincarnations.
The second draft of the script states that Phil was cursed by his ex-girlfriend. After they trimmed her character from later versions of the script (finally removing her entirely from the film), that plotline made no sense, so they seem to have decided to simply leave it as an un-resolved question:
INSERT : A THICK BOOK The cover reads "101 Curses, Spells and Enchantments You Can Do at Home." A well-manicured feminine hand opens the book to a marked page .
INT. CHERRY STREET INN - NIGHT - SAME TIME : Phil enters his room and drunkenly tosses his overcoat, scarf and gloves on the floor in a heap.
INT. STEPHANIE'S BEDROOM - NIGHT : Stephanie Decastro, Phil ' s disaffected ex-lover, is sitting cross-legged on the floor with the book of curses open in front of her. Her hair is down, she's wearing a caftan with a Zodiac print, there are candles everywhere and other vaguely occult decorating touches.
INSERT : Phil's business card is dropped into a dish. Then the Tarot card of the Hanged Man, a chicken bone, and a feather are placed on top of it .
PHIL : He stands at the sink, looking at himself in the mirror, flexing his muscles.
STEPHANIE : Reading from the book she mutters incantations in a secret language, then she sprinkles some powder on the plate, then a few drops of oil. Then she makes a few passes over it with her hands and, much to her surprise, the contents of the plate spontaneously combust.
PHIL : As he crosses to the bed, he accidentally knocks over the suitcase stand, spilling his clothes out onto the floor.-25- He contemplates picking them up for a moment, decides to leave them there, and flops down on the bed. He lies there looking up at the ceiling until the room starts to spin around, then he closes his eyes and quickly drops off to sleep, still fully clothed.
STEPHANIE : To complete the spell, she picks up a broken wristwatch and drops it into the fire.
INSERT : Phil's business card, the Hanged Man and the broken watch in flames. The watch crystal is cracked and the hands are frozen at 5:59
It is also worth noting that in the earlier draft, the original spell kept Phil in the loop for 10,000 years(ish) and that it was Rita's kiss that finally broke the curse;
Phil : You want to know what's really amazing? I've been waiting for you every day for ten thousand years. I dream of you every night of my life. You've been my constant weapon against total despair, and just knowing you exist has kept me alive. How's that?
The first lines of the movie:
"Somebody asked me today...
"Phil, if you could be anywhere, where would you like to be?"
I said to him, "Probably right here."
In screenwriting, many devices are used to give us a clue of what the movie is about. Not what happens, but what it is about. For example, it could be said that many movies announce the premise of the story in the first scene. In this case, I think that this is more than a movie where the time repeats itself, its a movie about a selfish guy who has to learn to be open to the (sometimes chaotic) experience of living, and really share with other people. Many forms of belief (spiritual, most of all) would call this Be present in the moment: Be here. As Bill Murray says at the beginning... I said to him, "Probably right here."
So, the only way to get to this point of maturity is making mistakes over and over. Is a way of saying "you will make the same mistakes, over and over, until you learn the lesson about yourself and life".
I think many are missing this crucial dialogue in the movie:
Rita: I don't know what to say.
Phil: I do. No matter what happens tomorrow, or for the rest of my life, I'm happy now.
The loop broke when it was pointless to continue further: I think this is crucial. Each day before that one had the potential to be different, to be better; but not the one when he says that dialogue - it was already as good as we could hope for. Phil explicitly admits this, and the spell's broken.
I know of others' points that Rita was at the centre of it all, but I don't think she was that crucial, I'd rather say it had more to do with the groundhog and its shadow; the last day was the one that Phil didn't see his shadow.