Milking dairy cows are 'dried off' towards the end of the milking period each year. At this time the amount of milk they produce every day is falling, so the farmer simply stops milking them. In answer to your question, with the milk being produced in the glands not being removed, eventually the cow stops producing milk.
If you stop milking a dairy cow when she is in the middle, or near the start, of the milking season, the huge quantities of milk being produced gather in the udder and if not milked out can be quite painful for the cow. However, eventually she'll stop making milk and will dry off.
Hope this helps.