What does PARTITION BY change in a window function?
It splits the rows into independent windows, so that each row's window contains only the rows in its own partition. Without PARTITION BY, every row's window is the entire result set.
Think of it as a GROUP BY that does not reduce the row count. GROUP BY puts rows into groups and hands you one summary row per group. PARTITION BY puts rows into groups and hands you every row back, each carrying a summary of the group it belongs to. That is the difference in a sentence.
The three things that follow from it. A ranking function restarts at 1 for each partition, so ROW_NUMBER over a partition is a per-group sequence rather than a global one. An aggregate sums only within the partition, so a running total resets at each partition boundary. And the frame is applied within the partition, so a moving average never reaches across a group boundary.
Two details. The PARTITION BY expression does not have to match a GROUP BY grouping — it can be any expression the engine can evaluate per row, including one that is not selected. And the partitions are independent, which means the engine can compute them in parallel, so a well-partitioned window function is often as fast as the equivalent GROUP BY even though it returns more rows.