This is a very bad habit, and one that can be tough to break.
We went on vacation one time, and the girl I hired to care for the hens and collect eggs did not do a good job. She left the eggs too long in the nest boxes, and eggs started to get broken. Once they taste egg the game is on. By the time we returned home 2 weeks later every single hen was breaking eggs to get to the good stuff inside. We had to dispense with an entire flock (20) one year old hens. I was soooo mad!!
I am always diligent to avoid this bad habit. It usually starts as an accident. An egg gets broken by mistake, and some curious hen takes a taste. It can escalate quickly from there.
All of our flocks have golf balls in the nesting boxes from the very beginning. The minute chicks come out of the brooder and into a coop, they have piles of golf balls. By the time they are laying, they think pecking eggs just hurts beaks.
We collect eggs at least 2x a day.
We have ample box space. One box per 2-3 hens. Usually a whole flock (around 20 hens) will use the same 2 or 3 boxes, but they have options.
Our hens free range, have access to oyster shell and receive plenty of protein and calcium in their diet. Chickens will learn to break eggs if they are bored or lacking nutritionally. We don’t let those conditions happen.
If an egg is broken, we watch closely for a day or two and if we find a hen breaking eggs we get rid of her immediately. Of course, sometimes the roo’s learn to eat eggs. I HATE when that happens because a good roo is far harder to come by than a good hen.
Long story short, it is a really bad habit, hard to break and can cost an entire flock because one chicken breaking egg can lead to 20 chickens breaking eggs in a real short amount of time.
Good luck!!