The story is told out of chronological order, and this can make it difficult to put the pieces together as we read. In part 2, we learn that thirty years ago, Miss Emily Grierson "vanquished" town leaders, around the time that a terrible "smell" emanated from her property. The narrator also says that this was "two years after her father's death" and just a "short time after her sweetheart" had left her. At this time, even those few ladies who tried to visit Miss Emily were not allowed to enter her home.
We also learn, in part 2, that Emily's father felt that "none of the young men" who came to court her "were quite enough for Miss Emily." She had trouble parting with her father's body after he died, and people felt that "she would have to cling to that which had robbed her," in recognition of "all the young men her father had driven away." Essentially, Emily's father refused to allow her to marry anyone during his life, and then he left her all alone when he died.
In pat 3, we learn that Emily grew very sick after her father's death. When she recovered her health, she was often seen around town with Homer Barron, a Yankee laborer hired by the town to pave the sidewalks. People believed that "she was fallen," that she had slept with Homer. One day, she went to purchase arsenic, but she refused to tell the druggist what she intended to do with it.
In part 4, we learn that Homer went away, and people in town thought Emily would kill herself. The minister visited her about her relationship with Homer, and then his wife wrote to her relatives. Emily purchased some gifts that seemed to be wedding gifts for Homer: an engraved "man's toilet set in silver" and a full suit of men's clothes. Finally, her cousins appeared to have given up on her; they left town, and Homer returned. A neighbor saw Miss Emily's servant admit Homer to the house one night, and then no one ever saw him again after that. For a long time, no one saw Emily, and it was at this time that the men went to "sprinkle the lime" around her home to eliminate the bad smell. We also learn that her hair "attained an even pepper-and-salt iron-gray" color, a "vigorous iron-gray" that was pretty distinctive. After this point, Emily mostly remained a recluse. Time went on, and one day she died.
In part 5, the neighbors come to see the home after Emily's death, and Emily's servant simply leaves the house, never to return. Emily's family comes, and they bury her, but everyone "knew that there was one room" that "no one had seen in forty years." They waited until after Emily's funeral to force the door. The room was "decked and furnished as for a bridal," as though Emily had prepared the room for her wedding night with Homer, all those decades before. Everything is covered in dust, and the air smells "acrid," like a tomb. Homer's long-decayed body lies in the bed, "apparently once lain in the attitude of an embrace." On the pillow next to his, they find a "long strand of iron-gray hair," the hair that was so unmistakably Miss Emily's. She has, evidently, been sleeping next to his mouldering corpse for years.
Thus, we can now begin to put together the pieces: Emily, seeing that Homer would either choose to leave her or that she would be compelled to part with him, poisoned him with the arsenic. It was the smell of his decaying body that had so pervaded her property that men had come at night to deal with it decades before. Rather than be abandoned by Homer, as she'd been abandoned by other suitors and her father, she killed Homer to keep him with her. She seems to have indulged in some fantasy that they were married rather than come to terms with her terrible and unbearable solitude.