According to Mark Vanhoenacker, a British Airways pilot writing for Slate, as an aircraft climbs higher, the air pressure drops both outside and inside the plane.
However, the pressure drops far lower outside as the aircraft's pressurisation system will keep the cabin at a comfortable and safe level for passengers.
The middle and outer panes, says Vanhoenacker, are "designed to contain this difference in pressure between the cabin and the sky."
The layer closest to the passenger is known as the 'scratch pane', and simply works to protect the more important outer panes.
This is safer for the aircraft and also makes the cabin more comfortable for passengers.
Additionally, it also allows moisture to leave the aircraft and prevent windows from fogging up. Although, from time to time you may notice a small pattern of frost form during particularly cold spells.
As for the shape of a plane window, there is a tragic reason why they are round, not square.