CSES Problem: Maximum Subarray Sum II

I don’t understand the solution of this problem given on USACO. Please help me understand what the problem actually wants, and what should be our approach in order to solve this problem, explaining every step.