WARNING: Major SPOILERS For Star Wars: The Force Awakens Follow!
Around the halfway point in Star Wars: The Force Awakens, we learn that R2-D2 has been in low power mode ever since Luke Skywalker disappeared. A detailed explanation isn't offered for how and why he wakes up, though director J.J. Abrams and original screenwriter Michael Arndt have now shed some light on that. Before getting to that though, the latter explained how exactly the dormant astromech had that map to Luke's location in his system despite being in a coma of sorts for the majority of the movie. "We had the idea about R2 plugging into the information base of the Death Star, and that’s how he was able to get the full map and find where the Jedi temples are." Abrams elaborated on that by stating: "[The] idea was that in that scene where R2 plugged in, he downloaded the archives of the Empire, which was referenced by Kylo Ren."
That makes sense and is what I think most of us had probably assumed anyway. As for why R2 wakes up, it seems like his awakening came as a result of an earlier interaction with BB-8. "BB-8 comes up and says something to him, which is basically, ‘I’ve got this piece of a map, do you happen to have the rest?’ The idea was, R2 who has been all over the galaxy, is still in his coma, but he hears this. And it triggers something that would ultimately wake him up. While it may seem, you know, completely lucky and an easy way out, at that point in the movie, when you’ve lost a person, desperately, and somebody you hopefully care about is unconscious, you want someone to return." That's a reasonable enough explanation, though R2-D2's return does coincide with Rey embracing the path of a Jedi, so could Luke have used the Force to wake him? We'll get an answer to that in around eighteen month time! For now, share your thoughts and theories below.