The primary distinction between a pergola and a gazebo lies in the roof design. Gazebos and pavilions offer complete protection from the sun, while pergolas feature a slatted roof that allows sunlight to filter through. Generally, pergolas provide partial shade and shelter over gardens, pathways, or patios, making them a popular choice for enhancing outdoor spaces.