If you use =REDUCE(0,A1:A4,LAMBDA(a,b,b)) on 1, 2, 3, 4 it returns the value last of the last row as a result, i.e. 4. The formula above does that for every row of 1, 2, 3, 4 (or 4, 3, 2, 1) and adds the result of previous calculation (a+b) to it, i.e.
1st step is 4 + initial value of a which is 0, therefore 4,
2nd step is 3 + the result of previous iteration, i.e. 4, therefore 3+4 = 7,
3rd step is 2 + 7, i.e. 9
4th step 1 + 9, i.e. 10.
The same output (although sorted in reverse order) could be achieved e.g. with =INDEX(A4,0,0)+B5 placed into B4 and copied up where B5 is 0.