Consider something like a start with a 128-bit value and input 128 bits at a time, and XORing each of these input blocks with an existing value.
MD5 is much more complicated, but the general idea is the same: the input is processed 128 bits at a time. Each input block can change the value of the result, but does not affect the length.
source share