There are so many ways to get in and out that I will not claim how they did it. The Nest cam does use a cloud service so that could be how it's done. I'm not going to write anything technical here. No code, no Internet protocol or router talk.
Simply the camera has a link to the cloud and the app uses that.
I just purchased a Nest Cam and installed the app. It works just fine and I can watch my house from out side. But always wondered, how can this device reconfigure my router to create some type of port forwarding so It can access my router from out side. Do they use any type of Script that manipulate the router config during the installation like mimuPnPd?