human mothers can carry babies to safety. Mother goats can't. This means that offspring are high risk of predation except if they can run from birth. Can't run at birth? Won't likely survive to reproduce.
It is really a case of level of protection that the parents can provide. Grazers are not typically all that great at providing protection for offspring. Their survival strategy is to run away. Kind of fits the old saw: I don't need to outrun the bear: I need to outrun you (so the bear gets you not me).
Obviously, there is benefit to the human to give birth earlier than allows for the child to be able to run. Babies are about as big as they can be and not kill mom while getting out. Especially the head size part. The head has to develop a lot and fast and that would kill the mom if done during the pregnancy.
Lots of animals have relatively helpless offspring at birth. They tend to be able to hide, isolate, and protect the offspring until they can fend for themselves. Look at most birds as an example. For them, egg laying is a size-limiting factor, and since eggs can only be just so big, that limits how mature the newborn can be.