What does “ mod” mean?

I can see the pattern as I adjust the second value in the parentheses, but I still don’t understand why the function behaves as it does?

I can see the pattern as I adjust the second value in the parentheses, but I still don’t understand why the function behaves as it does?