By this line your're creating your wsgi web application.
app = webapp2.WSGIApplication([('/', MainHandler) ], debug=True)
So let's break it to smaller parts.
If you're familiar to web programming in any language (and in general to concept), you should know that your server should know what url's is he going yo serve. In your case you have registered "/" (root) url, which is the same as http://127.0.0.1/. And also you have defined that the response for "/" url will provide MainHandler class.
('/', MainHandler)
So when the request will reach your wsgi server it will be redirected to your MainHandler's get method. In general your get handler should make a proper http response. As your MainHandler class inherited from the webapp2.RequestHandler class it already have some tools to make a response, so you will not take care about http headers and so. By the following line you're forming the response, which is in your case just a simple string "Hello World".
self.response.write('Hello World')
After your get function invocation the wsgi server will send back to the browser already formed http response like this:
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: length
Hello World.
You can also check this tutorial for further details on webapp2 framework.
Good luck.