Hotjar works by aggregating various forms of user data, including heatmaps, session recordings, and surveys. Heatmaps visually represent where users click, move, and scroll on a webpage, while session recordings allow businesses to watch real-time interactions. Additionally, surveys and feedback polls provide direct user feedback, helping businesses identify pain points and areas for improvement.