Yes, getting the hearts up for an animal, along with keeping it happy (by keeping it fed, warm in the winter, etc), will give you the chance for large milk and eggs.
As to some gaining and some not... are you sure they are not? Are they possibly just behind a bit? Or are they possibly not gaining as quickly? What professions do you have for farming?