I think I see why it works now:
For some L₁, say L₁={4,5,7,0,3} , cumSum(L₁)={4,9,16,16,19} where 19=sum(L₁)
So, when randInt(1,sum(L₁)) is called, there is a 4/19 chance the random number is less than 4, a 9/19 chance it is less than 9, and so on. 1+sum( finds how many "bins" the random number falls into, and picks the largest bin. The odds of the number falling into a smaller bin are subtracted off, giving the desired probability.
So yes, it does the same thing.