, why the value of each line are different?
window w as (partition by department_id order by salary desc);
This isn't an admin question; general or novice would be a better mailing list.
The answer is you added an order by clause to your window definition. The docs explain why doing that results in each row of the partition only summing the rows before and including the current row.
David J.