Many passive mobs are possible to get through breeding. Some animals also spawn in when a new chunk is created. Many mobs can also spawn into the world, just like hostile mobs, but this is not all that common. The reasons for this are that the mob cap for passive mob spawning is much smaller than the one for hostile mobs, and also, passive mobs do not despawn in the spawn chunks, and therefore, they may be constantly loaded, filling up the spawn cap.
However, if the spawn chunks are cleared from all passive mobs, and is made a passive mob spawn proof perimiter, the passive mobs will again be able to spawn freely. This is the basic principle behind how passive mob farms work.
Passive mobs attempt to spawn every 20 seconds. The spawn cap is only checked at the beginning of the spawn cycle, and therefore, if there is a sufficient amount of spawnable spaces, you may get more passive mobs than the mob cap actually allows.