Cows are manipulated to produce much much more milk than they would naturally. Also the machnines doing the work are harsh and painful. But even when it is from a farmer doing everything by hand on a really happy cow. Being vegan means in the first place avoiding everything produced by or out of animals. The rule "It must not harm any animal to be vegan" is an additional rule for products which are not made by or out of animals.
Standard super market milk violates both rules.
Source: A friend of mine is vegan since almost 20 years (before it was hyped).
Animals only produce milk for their young. In order for humans to take that milk humans forcibly impregnate the animal then kill its young shortly after birth - never giving it any of its mothers milk. That’s why all dairy is not vegan.
Milking a cow requires that you keep the animal producing milk which means numerous pregnancies that produce either another dairy cow that has been born into milk slavery or a meat cow destined for the slaughter house after fattening. I'm not sure where people get the idea that milking hurts the cow as it doesn't. The machines are automated and some are ones the cows voluntarily enter for milking. If the cows don't milk regularly it can be painful for them.
Source: A friend of mine is vegan since almost 20 years (before it was hyped).