Milk is always associated with happy cows roaming freely on a meadow, however, the reality is completely different for most of the milk cows: industrial farming, artificial insemination, separation from calves, artificial stimulation to maximize production is the reality.
Like all mammals, cows produce milk for their young, however, this is not the case on the milk farms. Calves are taken away right after birth and kept in plastic cubicles. Young males are often killed just after birth or kept until they reach the desired weight/age and then slaughtered. Females are kept until they are mature and ready to become milking cows.
Cows, before they are taken to the slaughterhouse, get pregnant a few times, so they can be milked as long as their body is able to produce milk.