The physical cause of Mrs. Mallard's death is, of course, the "heart trouble" that Chopin tell us about in the first sentence of the story. The underlying cause of the heart attack from which Mrs. Mallard dies is most likely the shock of bitter disappointment when she realizes that her husband is still alive.
When Mrs. Mallard first hears of her husband's death in the train wreck, she responds as one would expect--"she wept at once, with sudden wild abandonment, in her sister's arms." During the period in which the story takes place, everyone around Mrs. Mallard would expect her to dissolve into grief at such news because, in a conventional marital relationship, the loss of a husband would be truly traumatic for personal (love of her husband) and economic (he was the provider) reasons.
What leads us to understand that she ultimately dies of disappointment is the scene in her room. When she goes up to her bedroom alone, Chopin tells us that she was "pressed down by a physical exhaustion that haunted her body and seemed to reach down into her soul," a condition we would expect in a woman whose life has just been altered in such a tragic way.
Almost immediately, however, we are presented with scenes of life and hope--"delicious breath of rain," "countless sparrows were twittering in the eaves," "patches of blue sky"--all very positive images of life rather than death. The ending of the bedroom scene makes it clear that, despite the fact that she has lost her husband, her reaction to this is not despair but absolute joy, expressed by her whispers of "free, free, free!"
Mrs. Mallard goes on to realize that her life is now her own, and she is free from the repression that characterized her marriage, even though her marriage appears to be relatively pleasant. What seems to be important to her, now that her husband is dead, is that "there would be no powerful will bending hers" ever again.
Given the transformation we see Mrs. Mallard go through in the bedroom--from repressed married woman to a woman with complete freedom--we are led to conclude that her fatal heart attack, when she learns that Brentley Mallard is alive, is not the result of joy but of disappointment that her sudden freedom has been cut short.