In this, the final line of "The Story of an Hour," the repressed wife who learns the news of the railroad disaster where her husband is assumed dead, rejoices in the privacy of her room at the "moment of illumination" and the realization that she has been released: "Free! Body and soul free!"
Then, just at the moment that she descends the stairs with the aid of her sister since she suffers from heart trouble, the latchkey turns and in walks her husband from a trip, unknowing of any disaster. The shock of seeing the man from whom she thinks herself finally freed is more than Mrs. Mallard's heart can handle. The supposed "joy" of seeing her husband alive is, ironically, a literal heart-breaking shock to the woman who, for a moment, thought her life would be her own, not the relief of seeing a dead loved one alive.
This is an example of irony ... we know something that the characters in the story do not. They think that Mrs. Mallard died from the sudden joy of finding out that her husband, who she thought was dead, was really alive and never in any danger. Thus, they presumed, she died of joy.
We know differently. We know that she died of shock when the new life she had envisioned for herself, a life free of all the constraints that he put on her, was suddenly gone, and that she was "imprisoned" once again. She might have died of heartache, but it certainly wasn't joy that did her in.