Consider the following function: f(x) = xx. Now, given that you know f(x)=25, what is x? Well, the answer could be 5 or the answer could be -5. You cannot recover the input to f, because there exists some value in the range of f such that more than one element of the domain of f maps to that value under f. Consequently, the function f is non-invertible. The same concept applies to MD5; there are multiple inputs to the MD5 algorithm that will, despite being different inputs, yield the same hash value as a result. In other words, the MD5 algorith, like f(x)=xx, is not one-to-one and therefore not an invertible function.
However, this does not mean that you cannot recover the input to an MD5. It simply means you cannot recover the input to and MD5 with 100% certainty. To make this more concrete, let's look again at the function f(x)=x*x. Now what if I told you that for any given input to f the probability of it being positive is 99%? In that case, you could make a very good guess that a hash of 25 came from a value of 5, and not -5. This is, indeed, how people are able to break hash functions (including MD5, which is, it turns out, not a very good cryptographic hash function). When it comes to passwords, there are certain passwords which are used far more frequently than other passwords. All you need to do is take the MD5 of those password and compare it with some hash, and if they match, then it is a pretty reasonable guess that it came from that password.
You may also be interested in reading about one-to-one functions, Injective functions, cryptographic hash functions, MD5, SHA1, and Don't Hash Secrets from the Benlog Security Blog.