MD5 work fundamentally differently from CRCs.
I'm not familiar with CRC algorithms, except only for knowing that they provide basic high-throughput integrity protection.
MD5 (along with others in Merkle-Daamgard cryptographic hash functions family such as SHA-1, SHA-256, etc.) has roughly 4 layers:
Merkle-Daamgard construction: which consists of
MD-compiliant message padding - for making sure messages of different length results in different sequences of message blocks. Different messages of same length is not the main concern for the MD-compilant padding.
A series of iterations of the compression function $C(h,m)$, where $h$ is the digest from the previous iteration of the compression function (or the initialization vector if this is the initial iteration); and $m$ is the message block for the current iteration.
The construction of compression function from blockciphers.
The Davies-Meyers construction is the one used in MD5, SHA-1, and SHA-2 family. It encrypts the digest with the message block as the key, then adds or xors the digest to the new output block to make the compression function one-way.
The construction of blockcipher.
There are 2 major paradigms - a) Substitution-Permutation Network (SPN), b) Feistel Network. MD5, SHA-1, and SHA-2 family uses the latter.
A Feistal Network iteratively alter one half of the blockcipher block with a value calculated using a round function from the other half of the block - the round function calculation involves the subkey derived from the main key, which in the case of hash functions, is the current message block.
Construction of round function.
The main concern of Feistal Network is to increase confusion and diffusion by iteratively applying the round function, and the round function needs to provide some necessary minimum randomness.
- The ARX paradigm (arithmetic addition, rotation/shifts, and xor operations) is a popular choice.
- Binary polynomial is another.