It generally starts by accident. An egg gets stepped on or otherwise breaks, one curious hen pecks at it and thinks - hmm this tastes good. She will then start breaking eggs as they are laid, and soon other hens will follow her lead and you'll have a whole flock laying eggs and proceeding to eat them.
There are several things that can cause egg eating to start:
1) Weak-Shelled Eggs
Even a good layer feed doesn't provide enough calcium for really strong shells. If your shells are weak, a hen can step on, and inadvertently break it. Providing free-choice oyster shell or crushed eggshell can help with that. As long as you crush the eggshells into 1/4" or smaller pieces, the chickens won't associate the shells with eggs, so don't worry about feeding crushed eggshell leading to egg eating. I have been doing it for years and not had once incidence of egg eating. Ever.
2) Not Enough Bedding in the Nesting Boxes
There should be at least 2" of soft bedding (straw, pine shavings, shredded paper, etc) in the nesting boxes to prevent eggs from breaking on the hard floor. A sheet of rubber shelf liner on the bottom of the box can also help prevent broken eggs.
I have tried both straw and shavings, but prefer straw for the nesting boxes. I have found it holds its shape better and often using shavings the chickens will make a 'bowl' in it right down to the nesting box floor and the egg will be sitting on the bare floor.
3) Not Enough Nesting Boxes
You should provide one nesting box for every 4-5 hens.
That's not to say that they won't all want to use the same one, but it can cut down on scuffles and broken eggs to provide enough boxes (or baskets).
4) Broody Hens
Broody hens can contribute to broken eggs as they fight to hold their ground and not give up a nest. Yet another good reason to break broodies if you aren't hatching eggs.
5) Leaving Eggs in the Nesting Boxes After They are Laid
Eggs should be collected as quickly as possible to avoid having them sitting in the nesting boxes creating a temptation.
Replace the eggs with golf balls, plastic Easter eggs, ping pong balls, wood or ceramic eggs so they will start to find that when they peck at 'eggs' they don't break and tasty yummy inside after all.
In extreme cases, the nesting boxes can be replaced with the roll-away type where the floor is slanted and the eggs literally roll out into a collection tray as soon as they are laid.
6) Not Enough Protein
Ironically, feeding your chickens eggs can actually get them to stop eating their eggs. A protein deficiency can make them crave the egg, so add some cooked scrambled eggs to their diet and see if that puts a stop to it.
7) High Visibility Nesting Boxes
Believe it or not, hanging curtains across the front of your nesting boxes can deter egg eating. Apparently 'out of sight, out of mind' applies here. The curtains not only shield the eggs from open view, they make the boxes darker. If passing hens can't see the eggs as well they aren't as tempted to investigate.
Other causes may be boredom which can be 'cured' by providing outdoor roosts or logs for your hens to stand on, piles of dirt, leaves or weeds to rummage through, a hanging treat feeder or even a mirror in the coop or run.
Urban Chicken Legend: Something oft-mentioned on the internet to stop egg eating is to blow out some eggs and fill them with mustard and/or Tabasco hot sauce. The theory is that hens will learn pretty fast that eggs don't taste good. However, it's been proven that hens tastebuds aren't designed to taste or feel the hot sauce, so don't bother..... however, the hot sauce or mustard WILL help deter rodents or snakes from eating the eggs.
With a little persistence, it is possible to break a hen of egg eating. Culling should only be considered as a last resort.