In the comics, Carol's death is rather unexpected and comes as a result of a complex series of events involving a zombie attack and her own risky decisions.
Carol's death in the comics occurs at a specific point, but I can't recall exactly when off the top of my head. You might need to do a detailed re-read to find out.
Carol dies in the Walking Dead comic book when she's overwhelmed by a massive zombie horde. There's no way for her to fight them all off and she succumbs. It's a heart-wrenching scene for fans of the series.