Framing a picture will protect it and provide a means to hang it for display. The right frame will also enhance its appearance and help it to better fit into the environment where it is displayed. It's a bit like a window into the world of the image.
Windows (not the Microsoft variant) probably originated as a convenient way to let light and air into a dwelling. At the same time they also allowed the occupants to see beyond the confines of their walls, and passers-by to catch a glimpse of what lay within. Using a window like a frame in a picture can strengthen the composition, providing context and additional points of interest. The light the window was designed to let in, can reveal to the curious eye what lies beyond it, or allow the light within to escape.
Now I'm not suggesting we all become paparazzi or peeping toms and start invading private spaces we have no business looking into. There are plenty of public windows everywhere, and - within reason - we shouldn't be afraid to look through them. After all, that's part of the reason they were put there.