There are several things that could have caused it. She could have broken her neck when flying down from the roost, banging into something on the way down. Or maybe another chicken jumped her, either a rooster for mating or another hen due to pecking order stuff, and she hurt herself trying to get away. She could have gotten her head caught somewhere just enough to break her neck when trying to get loose, then gotten loose.
She may have eaten a poison, maybe mold or something else. Possibly a heart attack or a stroke. I had one die due to heat stress while laying an egg this year. Different things can cause a sudden death.
There are several other things that can kill them, but often there is some wasting away or lethargy involved. Not always, but usually. These include diseases, internal organ damage, even mites and liced, or internal injury from something they swallowed.
Odds are it was nothing you did or failed to do. If you have living animals you will sometimes have to deal with dead animals. It is a sad part of animal ownership.