Pretty much what @FrostRanger said. Much like humans where a healthier mother can provide better nutrition to her baby, a healthier chicken can put more nutrition into her yolks for any potential chicks. We get the benefit when we eat those eggs. One visual cue is that home grown eggs frequently have darker egg yolks than commercial ones.Interesting, mine don't have access to grass. How much does that matter to the "health" of the eggs?
When possible, chickens do benefit from free ranging. They have access to a wider variety of plants, insects, more sun, etc. I understand that not everyone has that option.
Most all backyard chicken owners at least have much better living conditions- far more space than factory farms which affects their stress levels, access to sunlight, ability to exercise and socialize. Also, if you provide a good quality feed and a limited (<10%) amount of healthy treats, then you know they will have good nutrition.