Heatmaps collect data on user interactions, such as clicks, scrolls, and mouse movements. This data is then aggregated and displayed in a colored overlay on the webpage. Warmer colors like red and yellow indicate areas of high interaction, while cooler colors like blue and green indicate areas of low interaction. This provides a clear, immediate visual understanding of user behavior.