Hens usually leave their eggs. One who sleeps on them at night but leaves them alone all day is probably just sleeping in the nest box, and doesn't care whether there is an egg in there or not. You should not let your hens sleep in the nest boxes, because you will have poopy eggs.
When a hen goes broody, meaning she will sit on the eggs til they hatch, this is a hormonal change which results in several behavior changes. Besides staying on the nest 24/7 (except for one outing a day, to take care of business) she will growl and fluff up when anyone comes near, is likely to fight or peck if you try to touch her, will fuss and fluff out if you take her off the nest, as well as return to the nest within a few minutes. Sometimes they return to the wrong nest -- they often don't seem to realize which one they'd been on. Broodiness becomes mothering after the chicks hatch, for a few weeks. She willl stay with them, teach them to eat and forage and dust bathe, and protect them from the rest of the flock. While broody, hens don't lay eggs.
Some hens live for years and never go broody; some go broody once or twice in their life, and some do it regularly. It's largely dependent on breed, although you can get a broody in a supposedly non-broody breed like Leghorns. Hatcheries have been selecting for non-broodies for decades. Our breeds section (top of page) can help you find breeds that are likely to go broody.