Mary Lennox is a troubled, sickly, and unloved 10-year-old girl born in India to selfish, wealthy British parents who never wanted her. She is primarily cared for by servants, who pacify her as much as possible to keep her out of her parents' way. She grows into a spoiled and selfish girl. Eventually, there is a cholera epidemic in India which kills Mary's parents and all the servants. Mary is discovered alive but alone in the empty house. 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 heard of let alone met, at his miserable, isolated mansion 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 keep herself amused without much attention. 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. Mrs. Craven was killed when a tree branch fell on her in the garden, and the devastated Mr. Craven locked the garden and buried the key. Mary is piqued by this story and her ill manner begins to soften. Soon, she comes to enjoy the company of Martha, Ben Weatherstaff the gardener, and a friendly robin redbreast whom she assigns a human personality. Her appetite increases, the bracing air improves her health and she grows stronger as she plays by herself on the moor. Martha's mother buys Mary a skipping rope to encourage this, and Mary takes to it immediately. Mary occupies her time wondering about both the secret garden and the cries she hears at night. The servants claim not to hear the cries.
As Mary is exploring the periphery of the gardens, her robin friend draws her attention to an area of turned-over soil. Mary finds the key to the locked garden, and eventually the door to the garden. She asks Martha for garden tools, which Martha sends with Dickon, her twelve-year-old brother. Mary and Dickon take a liking to each other, as Dickon has a kind way with animals and a good nature. Eager to absorb his gardening knowledge, Mary lets him in on the secret of the garden.
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. She soon 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 spinal problem. Mary visits every day that week, distracting him from his troubles with stories of the moor, Dickon and his animals, and the garden. Mary finally admits she has access to the secret garden, and they decide Colin needs fresh air. 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 Colin's mother's garden, he admits he believed Colin to be a cripple. Colin stands up from his chair and finds that his legs are fine, though weak from disuse for so long.
Colin spends every day in the garden. The children conspire to keep Colin's recovering health a secret so he can surprise his father, who is travelling and still mourning his late wife. As Colin's health improves, his faraway father sees a coinciding increase in spirits, culminating in a dream where his late wife calls to him from inside the garden. When he receives a letter from Martha's mother, he takes the opportunity to finally return home. He walks the outer garden wall in his wife's memory, but hears voices inside, finds the door unlocked, and is shocked to see the garden in full bloom, including his healthy and invigorated son. The servants watch, stunned, as Mr. Craven walks back to the manor and Colin runs beside him.

Question: What animal did Mary become friends with?
Answer: A robin redbreast.