Wikipedia's "Modulo operation" page explains it quite well. I won't try to do any better here, as I'm likely to make a subtle but important mistake.
The rub of it is that you can define "remainder" or "modulus" in different ways, and different languages have chosen different options to implement.