Gargoyles originated in medieval Europe and were incorporated into the design of churches and cathedrals to serve a practical purpose. As rainwater management systems, they were designed to channel water away from the building's walls and foundations, thereby preventing damage caused by erosion and water infiltration.