I don't get the joke at all. Why buy the cow when milk free? What?

Is it a marriage analogy?