The ending of The Turn of the Screw is famously ambiguous, meaning it is unclear why Miles died. In the final paragraphs of the novella, the governess believes she sees the ghost of Peter Quint. Miles also seems to see someone or something, and the governess insists that she tell him what it is. He appears to say, "Peter Quint—you devil!" but it is not clear whether he is referring to Peter Quint or his governess as the devil. The governess then explains to the reader that she feels she has won the battle for Miles against Peter Quint.
At the very end of the story, the governess catches Miles, stating,
I caught him, yes, I held him—it may be imagined with what a passion; but at the end of a minute I began to feel what it truly was that I held. We were alone with the quiet day, and his little heart, dispossessed, had stopped.
There are two possible explanations for what happened to Miles. The governess understands his "little heart" as having stopped because the devil, Peter Quint, left his body or "dispossessed" him. In this supernatural reading, freedom from the demon's grasp means Miles's death—it is the price he has to pay to rest in peace.
However, another explanation is that the governess has gone insane. In this reading, it is she who thinks she sees Peter Quint and who, in "saving" Miles from this figment of her imagination, smothers him to death. After all, she says, she holds him with a "passion," suggesting her grip may have been far too hard.
James leaves us with two possible explanations, and what we choose to believe is based on how sane a narrator we think the governess is and how prone we are to believe in supernatural explanations.