Wikipedia (https://en.wikipedia.org/wiki/MD5) explains it pretty well:
The MD5 message-digest algorithm is a widely used cryptographic hash function producing a 128-bit (16-byte) hash value, typically expressed in text format as a 32 digit hexadecimal number. MD5 has been utilized in a wide variety of cryptographic applications, and is also commonly used to verify data integrity.
So, MD5 can calculate a (somewhat) unique number to verify if a file's integrety is OK and if there wasn't any tampering and/or data corruption.