What is the primary function of the reproductive system in farm animals?