OVER() is used to compare the current row with an aggregate. For example, we can compute the difference between an employee's salary and the average company salary. Why don't we calculate the difference between these two values? Take a look:
AVG(Salary) OVER() AS AvgSalary,
Salary - AVG(Salary) OVER() AS Difference
The last column shows the difference between an employee's salary and the average salary. That's the typical usage of window functions: to compare the current row with the aggregate of a group of rows. Window functions make it possible to do such comparisons with a simple query.