Hens will sometimes leave eggs that can hatch, if they are late hatchers, and her other chicks are ready to run around. The little ones start venturing out if the, she does her job, and goes along to protect them. She can't watch over the already hatched, while taking care of the unhatched. This is one of the several reasons it's not good to add more eggs (not saying that's what happened here, sometimes some are just slow, sometimes some just don't hatch) after she's already setting on some. They all need to start at the same time.
During incubation when hen kicks an egg out, it's usually a dud. The ones that have developing chicks begin to generate body heat, so when mom gets off the nest for her daily break, the live eggs stay warmer than the dead ones. When she gets back on the nest, some will be warmish, some will be cold as a stone. She'll kick those colder ones out of the nest. I doubt she understands what it means, she just feels those cold, uncomfortable lumps under her, and doesn't like it. Out they go. Or, if they're to the point they smell bad, that'll do it, too.
So yes, they can tell when an egg is bad, but it's not some mystical process. It's just warm vs. cold, or good smell vs. bad smell, or live, peeping chicks, vs. just eggs. We humans just don't understand what we're observing, sometimes.
ETA: If you have a 'bator handy, you can stick abandoned eggs in it, if they look good when you candle them. Give them a day or two, they might hatch. If they don't hatch by then, they're probably dead. My DH once picked up eggs left over when mama left the nest, and put them in the big green garbage can out back. It was a warm day, the eggs were in a bag, and the garbage can got nice and warm. A while later he went out the back door and heard peeping in the garbage can. There were two hatched chicks in there! He took them out, and they were fine. It was a few years ago, I don't remember if we snuck them under mom at night, or what.