Oh, I'm so sorry you lost one. Unfortunately it does happen to all of us at some point... that's how we learn to be better caretakers. And trying to figure out what happened is a huge step in the right direction.
Who knows exactly why this pecking/tail pulling started in the first place... sometimes other chickens sense a weakness or illness and just naturally peck them away. Sometimes it's just one bully that's a problem, it which case you could separate her from the flock for a week or so. That would change the flock pecking order somewhat while she was gone and her attitude is usually adjusted when she gets returned to the group. A good separation pen is a large wire dog crate. You could pick one up from Craigslist for fairly cheap.
I don't know how big your area is where your chickens live. The general rule is 4 sq ft per chicken inside the coop and 10 sq. ft per chicken outside. So for 5 hens, you would need a coop around 4'x5' and run space of at least 5'x10'. Without that much space, chickens feel cramped and just start pecking each other. And always make sure food is available free choice all day, two feeders is even better -to reduce territorial hogs.
read here:
How Much Room Do Chickens Need
Another thing to remember if you ever see an injured chicken --remove her right away. Leaving them among the flock hardly ever resolves the problem and only makes her a target for further injury. I know they can be difficult to catch, the easiest way is at night when they're on the roost sleeping. But if you can't wait that long, just move slowly to block her in a corner, usually a laying hen will crouch with wings slightly spread for a moment-- this is a "submissive squat" reserved for a rooster to mount. Then quickly use one hand to press her back and the other hand to reach under with fingers spread between her legs and lift her belly. Let her feet dandle - if they touch anything she'll want to struggle... even so, just keep holding firmly and tuck her head under your elbow (the same side that's holding her belly) so that her tail end is facing front and her head is at your back. She should be tucked between your arm and body so that her wings are confined so she can't flap around. You can search YouTube for "How to hold a chicken".
Then once you have her, put her in that dog crate/hospital room to heal. If you must return her to the flock before fully feathered, you can apply Blue Kote to the wound. It's a blue-colored spray that hides the red area and deters the others from pecking. Chickens LOVE to peck at red things. And they're omnivores, so they like meat too, and their first taste of blood can be exciting. That's the reason for separating an injured chicken.
To keep it from happening again... just make sure they have enough space and always have food and water available. As long as everyone is in good health, all should be peaceful. Free range time is helpful too. Or adding extra perches or activities to the run to prevent boredom. I started a thread and other people have posted some great ideas for treats to keep chickens active:
Winter Treats and Boredom Busters
Hope that helps a little
edit* I see I took so long typing my answer, others already said basically the same thing!