Presumably, when a cow's udders are overfilled - as with a lactating woman's breasts - they 'leak'. People must have noticed and, by giving them - the udders - a squeeze, found that the liquid expressed was tasty. Hey presto! From that moment on, they thought they were 'milking cows'.