Mary Lennox is a very troubled, sickly and unloved 10-year-old girl who was born in India to selfish, wealthy British parents who never wanted her and were too wrapped up in their own lives to love or care about her. She was taken care of primarily by servants, who pacified her as much as possible to keep her out of her parents' way. Spoiled and selfish, she is aggressive, surly, rude and obstinate. Later, there is a cholera epidemic which hits India and kills her parents and all the servants. She is discovered alone but alive after the house is empty. She briefly lives with an English clergyman and his family and is then sent to Yorkshire, England, to live with Archibald Craven, an uncle she has never met, at his home called Misselthwaite Manor.
At first, Mary is her usual self, sour and rude, disliking her uncle's large house, the people within it and most of all the vast stretch of moor, which seems scrubby and grey after the winter. She is told that she must stay confined to her two rooms and that nobody will bother much with her and she must amuse herself. Martha Sowerby, a good-natured maid, tells Mary a story of the late Mrs. Craven, and how she would spend hours in a private walled garden growing roses. Later, Mrs. Craven was killed by sitting in a tree and the branch broke, and Mr. Craven had the garden locked and the key buried. Mary is roused by this story and starts to soften her ill manner despite herself. Soon she begins to lose her disposition and gradually comes to enjoy the company of Martha, Ben Weatherstaff the gardener, and also that of a friendly robin redbreast to whom she attaches human qualities. Her appetite increases and she finds herself getting stronger as she plays by herself on the moor. Martha's mother buys Mary a skipping rope to encourage this, and she takes to it immediately. Mary's time is occupied by wondering about the secret garden and a strange crying sound that can sometimes be heard around the house which the servants ignore or deny.
As Mary is exploring the gardens, she is alerted to some turned up soil by the inquisitive robin, and finds a key belonging to the locked garden, and, next day, the door into the garden. She chances to ask Martha for garden tools, which Martha has delivered by Dickon, her twelve-year-old brother. Mary and Dickon take a liking to each other, as Dickon has a soft way with animals and a good nature. Eager to absorb his gardening knowledge, Mary lets him into the secret of the garden, which he agrees to keep.
That night, Mary hears the crying again. She follows the noise and, to her surprise, finds a small boy her age, living in a hidden bedroom. His name is Colin and she discovers that they are cousins: he is the son of her uncle; his mother died when he was a baby, and he suffers from an unspecified problem with his spine. Mary visits every day that week, distracting him from his troubles with stories of the moor, of Dickon and his animals and of the garden. It is decided he needs fresh air and the secret garden, to which Mary finally admits she has access. Colin is put into his wheelchair and brought outside into the garden, the first time he has been outdoors in years.
While in the garden, the children are surprised to see Ben Weatherstaff looking over the wall on a ladder. Startled and angry to find the children there in his late mistress' (Colin's mother's) garden he admits he believed Colin to be a cripple. Colin stands up out of his chair to prove him wrong and finds that his legs are fine, though weak from not using them for a long time.
Colin spends every day in the garden, becoming stronger. The children conspire to keep Colin's health a secret so he can surprise his father, who is travelling and mourning over his late wife. As Colin's health improves, his father's mood does as well, and he has a dream of his wife calling him into the garden that makes him immediately pack his bags and head home. He walks the outer wall in memory but hears voices inside, finds the door unlocked and is shocked to see the garden in full bloom with children in it and his son running around. The servants watch as Mr. Craven walks back to the manor, and all are stunned that Colin runs beside him.
...What was this under her hands which was square and made of iron and which her finger found a hole in?
It was the lock of the door which had been closed ten years and she put her hand in her pocket, drew out the key and found it fitted the keyhole. She put the key in and turned it. It took two hands to turn it, but it did turn. And then she took a long breath and looked behind her up the long walk to see if anyone was coming. No one was coming. No one ever did it seemed, and she took another long breath, because she could not help it, and she held back the swinging curtain of ivy and pushed back the door that opened slowly – slowly. Then she slipped through it, and shut it behind her, and stood with her back against it, looking about her and breathing quite fast with excitement, and wonder, and delight.
She was standing inside the secret garden.
— The Secret Garden (1911), pp. 74–75