Ophelia is completely overwhelmed by her father's unfortunate death. He was her advisor and warned her about Hamlet's deception and forbade her to have any contact with him.
Ophelia seems to be desperately in love with Hamlet who has rejected her, asking her to "get ... to a nunnery." It is difficult for her to understand Hamlet's inconsistent actions, for he later seeks her attention again, asking to lay his head in her lap during the performance of his play and making sexually suggestive references.
It is the knowledge of her father's untimely death, the fact that Hamlet has treated her so badly, and the realization that the one she loves is responsible for her father's demise, that drive Ophelia to mental breakdown. She continuously sings senseless ditties which are a confused jumble about death, dying, lost love and broken promises. This creates great concern in both Gertrude and Claudius about her emotional and mental health. They instruct Horatio to watch her closely.
Gertrude later informs Claudius and Laertes about Ophelia's drowning. She was out picking flowers from the banks of a river. One of the boughs on which she was leaning broke and she fell into the water, still singing. Ophelia made no attempt to save herself and she was dragged into the depths by her clothes which were weighted down by the water.
It seems as if Ophelia either lost all hope and chose to die, or that she was incapable, in her mental state, to understand the danger and therefore made no attempt to save herself.