I didn't figure this all out until we got our own chickens.
I even threw out an egg because it had been sitting outside for over a day. I didn't know at the time that a farmer has 30 days to sell his eggs. That the grocery store has another 30 days to sell the egg. And on top of that, you still have another 3 months before the egg actually goes bad.
Incredible! Even more incredible -- and this only applies to farm fresh eggs -- there is an anti-bacterial layer around the egg.
I am pretty impressed with eggs.