Lets first understand what is MD5 - The MD5 is a 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 which is commonly used to verify data integrity.
Now md5sum, md5sum is a computer program that calculates or verifies 128-bit MD5 hashes (for a file)
$ md5sum myfile.txt > md5hash (you can supply more then one file)
$ cat md5hash
$ md5sum -c md5hash
Say file got changed or corrupted then the last step will not give you OK as newfile md5hash would not be same as stored md5hash.