Why does the Lady of Shalott do what she does at the end of the poem?
We learn in part II that the Lady of Shalott "lives with little joy or fear" as she goes about her life, weaving in her tower and watching the events in Camelot through a mirror. She accepts the curse that says something terrible will happen if she even turns her head to look at Camelot. But at the end of part II, we learn that the Lady of Shalott is becoming restless and dissatisfied, "half sick of shadows."
At the beginning of part III, the Lady of Shalott sees Sir Lancelot, a handsome, vibrant knight who sings "tirra lirra, tirra lirra." Immediately, and without any initial explanation, the Lady of Shalott rises and defies the curse, looking down directly at Camelot. One is led to believe that she has fallen in love with Sir Lancelot and this compels her action, but it is also clear from the previous stanza that she had grown sick of watching life through a mirror: was she primed to fall in love with the first handsome man she saw?
After she dies, she is found floating down the river with a note she has written resting on her breast. Her words "puzzled" the "well fed wits" in Camelot. Her notes says:
The Lady of Shalott has lived under a curse for many years in which she is imprisoned in a tower and forced to view the outside world only through a mirror. She has been told that if she were to ever leave her tower and go to Camelot or even look out the window, something horrible will happen.
While she is able to endure her time by weaving, she can hear the knights and lovers pass under her tower window and soon comes to realize that she is "...half-sick of shadows" (Part II). One day, she sees the most brilliant knight of all, Sir Lancelot. The poem dedicates three stanzas to describing him followed by the lady's reaction:
She left the web, she left the loom, She made three paces thro' the room, She saw the water-lily bloom She saw the helmet and the plume, She look'd down to Camelot (Part Three)
She is unable to resist the beauty and pageantry of Sir Lancelot, so she accepts the curse and takes a boat toward Camelot. She accepts death and sings her song as she floats toward the beautiful kingdom, choosing on glimpse of beauty over her lonely fate in the tower.