One of my principles of the help I get on this forum is to never put a line of code in production I don't completely understand.
That's absolutely the correct spirit!
I believe the best thing for now would be for you to read the linked article. It explains a whole lot that I would only be regurgitating here. If after reading it, you still have questions about how it works, then c'mon back and we'll do our darnest to explain it. I guess the simplest explanation is that it works pretty much the same way that you'd do a running total in a spreadsheet without using the SUM() function.
--Jeff Moden
Change is inevitable... Change for the better is not.