Ranches, like fields and orchards, are special buildings that can vary in size, what they produce and when. Generally speaking, ranches grow cattle, but the final output resources depend on the cattle occupying it.
Unlike fields and orchards however, a ranch has upkeep other than coins: oats. Ranches will still produce some resources even without oats, but the efficiency will be drastically reduced, so it is advisable to plant an oat field (or fields) to fulfill the ranches requirements.
How do ranches work exactly
A ranch holds cattle. The maximum number of the cattle depends on the cattle in question. A ranch can hold more chickens than it can hold cows. Ranch animals will breed on their own, so increasing their numbers, but only if there is more room on the ranch to hold more animals. If there isn't, some animals will be processed for food and other resources, once again, depending on what the animal actually is.
The above doesn't mean that ranches only produce resources when an animal is slaughtered. Some animals provide resources for as long as they live. Chickens produce eggs, cows produce milk and sheep produce wool, all of which are resources used either directly as food or as an ingredient in a different production chain (wool is used in creating fine garments for example).