Factorialize a number algorithm

I’m on the Factorialize a Number quiz. I tried a few times then looked up hints and tried to understand their presented algorithm.I don’t understand why it works. Explain like i;'m five if possible.

function factorialize(num) {
for( i = 1;num >= 1 ; num--) {
    i = num * i;
  }
  return i;
}

factorialize(5);