I'm not sure how common this misconception is, but many people assume that female cows and goats produce milk all the time, automatically.
The truth is, that in order to produce milk, a dairy animal must first become pregnant and give birth. Therefore, in order to produce milk, female goats (does) must be bred regularly. Since keeping un-castrated male goats (bucks) in the city would be inappropriate (they can be very smelly), urban goat owners will need to take their does to a breeder who provides this type of service (for a fee, of course).
After a 5-month gestation period, the mother goat will give birth to 1 to 4 offspring (called kids). Goats can generally give birth unassisted just fine, but it's a good idea to be prepared to assist or call for help. To avoid overcrowding (especially important in the urban setting), you will have to find homes for most, if not all, of the kids. The baby goats can be retained by the owner (all male kids will need to be castrated), sold to another dairy farmer, sold or retained for meat (yes, you can eat goats), or sold as pets.