When the hen lays an egg the last thing she puts on it is a layer we call “bloom”. That’s what makes an egg just laid look wet but it quickly dries. The purpose of that bloom is to help keep bacteria out of the egg. It’s not perfect but it is pretty effective. It’s good enough that a hen can lay an egg a day for two weeks or more, then set on them for another three weeks, and bacteria hardly ever gets in even if the nest is on the ground and the eggs get a bit of dirt on them.
The problem comes in when something interferes with that bloom. It’s just on the surface and can come off. One of the worst things is if a clump of poop gets on it. That can remove the bloom from that part of the egg, even if you wipe it off. Leaving it on is worse. Bacteria grows in the poop and enters the egg. You’ll often see a difference in shell color right there if you wipe it off. The poop not only took the bloom off but part of the pigment on the shell too. I’m not talking about a real light smear but a clump. If for some reason there is mud on the egg, the same thing can happen.
If you wash the egg or just get it wet you have removed some bloom. If you sandpaper the egg you have removed some bloom. Even just brushing the poop or dried mud off can remove some bloom. This opens a way for bacteria to get inside. If you are going to incubate eggs, do not incubate really dirty eggs. A light smear is OK but no clumps. Don’t wash them, sandpaper them, or brush them vigorously either. I’ll gently brush a bit of dirt off and use those but not poopy eggs ore really dirty eggs.
If the bloom is intact you can probably store the eggs on your kitchen counter for months without the eggs going bad. If they are fertile eggs, keep the temperature below 80 degrees or even lower so the egg does not develop some but you can store them that way for a really long time.
If you wash them, sandpaper them, or brush them more than really superficially, store them in the refrigerator. They can still last for several months in a refrigerator even if the bloom is disturbed. Even if bacteria gets inside, it can’t multiply at refrigerator temperatures. That’s why you always need to refrigerate eggs you buy at the store. They have been washed.