Window functions are needed because sometimes we want to calculate totals or averages for groups of rows but still keep each individual row visible. Normally, GROUP BY groups rows and returns one row per group, hiding individual details. Window functions solve this by calculating aggregates over a 'window' of rows related to each row, defined by PARTITION BY. This way, each row keeps its data and also shows the aggregate value for its group. For example, we can show each employee's salary and the average salary of their department in the same result. The execution steps show reading each row, calculating the average salary for that row's department, and outputting the row with the added average. This helps us understand why window functions are powerful and needed in SQL queries.