In the cradle of civilization, Africa, homes probably had a wall opening to allow air to flow and to help regulate the indoor temperature. The heat and sun were the main elements that people needed protection from. A home was essentially permanent shade. Without airflow, however, that box of shade would quickly turn into an oven. These openings could also be used to look out for incoming dangers or animals that wandered near a settlement.
Later structures utilized these openings for a number of reasons. One major style that can be seen across Europe is a narrow and high opening. The arrow slit is a small vertical opening used in medieval castles to provide a firing point for archers during a siege. These openings, although macabre, were often added to later mansions and estates to maintain the original aesthetics even though there was no threat of attack.
Bay windows were also introduced during the medieval period as a way for a private dwelling to emulate a large cathedral. These structures often housed a small chapel where services could be held for religious noble families. They often featured elaborate stained glass motifs depicting either religious figures or noble lineages. When people settled in America, this style was incorporated into a number of luxury homes, because it was accepted as a sign of wealth. This is especially true when one considers the initial cost of glass, as well as how much it takes to maintain and repair it.
Shuttered openings are one of the most common sights in humid coastal or tropical areas. Places in the Mediterranean, Caribbean, or along the southern coast often have these structures. These windows let in cool air, but have attached shutters to keep out wind and rain. The shutters are often painted in bright or pastel colors, which gives homes in these beach communities their own unique style.
Homes across the world incorporated windows into their architecture for many different reasons, but they are always an important component for any building's functionality and style. It's possible that in the future these glass features will be incorporated with advanced technology, possibly turning them into solar panels or display monitors. No matter what happens, it is relatively certain they will remain a part of homes everywhere.