At the time that Mary is sent to live with her uncle, Mr. Archibald Craven, everyone agrees that she's a sour, thin, and disagreeable child. Because she was born in India, she's constantly sick and has a yellow complexion. Mary's father suffers the same ailments, while Mary's mother is beautiful, likes going to parties, and never wanted a baby. Mary's mother gave newborn Mary to an Ayah, and for the next ten years, Mary is kept out of the way of the rest of the house and given her way in everything. By the age of six, she's a selfish terror, and governesses leave their posts after only a few weeks.
Notice that the narrator attributes Mary's nastiness and poor health first to India and then to the way in which she's raised. This suggests that Mary will need to get out of India (which was then a British colony) if she's ever going to be a reasonable or nice child. By also blaming Mary's parents' neglect and the Ayah's requirement to give Mary her way, the novel also suggests that hired help like this can't properly raise a child.
When Mary is nine, she wakes up one morning and is angry when she sees that the servant waiting to help her isn't her Ayah. The woman looks frightened and only tells Mary that her Ayah can't come. Throughout the day, Mary notices that all the servants seem scared or missing. She's left alone for the morning and tries to amuse herself by making a pretend garden, though she also mutters about the names she's going to call her Ayah. As Mary is absorbed in this, Mary's mother comes onto the verandah with a young officer. Mary's mother seems scared and upset. The officer tells her that she should've left weeks ago, and when a wail rises from the servants' quarters, the officer is horrified to learn that "it" has broken out among the servants.
Though Mary is spoiled, nobody tells her what's going on because she's a child, and in everyone else's mind, she's therefore unimportant and undeserving of information. The fact that Mary never thinks to ask either speaks to the fact that she doesn't trust the adults around her and doesn't know that they can help her learn these things. The pretend garden that Mary creates shows that she does have the potential to be interested in nature and growing things, but that she can't fully embrace this interest in India.
Mary soon learns that cholera broke out, and the wailing meant that her Ayah died. Servants start dying one after the other, and those that don't die flee. On the second day of the outbreak, Mary hides herself in her room to cry and sleep. Everyone forgets about her. One evening she creeps out to find a partially finished meal on the table. She eats some fruit and drinks a full glass of wine, which makes her sleepy. She sleeps for hours. When she wakes up, the house is entirely silent. She wonders if she'll get a new Ayah and if the new one will know different stories, though she doesn't mourn her dead Ayah.
As far as Mary is concerned, her Ayah existed only to serve her and tell her stories; therefore, her death isn't especially meaningful. All that Mary cares about is that she has someone to bend to her wishes and keep her amused, which shows that even though Mary doesn't like or trust the adults around her, she still actively relies on them to keep her happy and comfortable.
After a number of hours, Mary hears a rustling and sees a small snake slithering through her room and out under the door. The next moment, she hears men enter the house, talking about how they suppose the child—who they're not sure even exists—died too. They open the nursery door a minute later and see Mary, looking hungry and neglected. She demands to know why nobody is taking care of her, but the men only exclaim that everyone forgot her and tell her that there's nobody left to come. Mary learns that both her parents died and the living servants left, totally forgetting about her.
While it's possible that Mary's seclusion is the reason that she's alive, it's also important to note that it could've killed her too if these officers hadn't come to check. This passage implies that parents need to cherish their children in such a way as to make sure that they'll be cared for if things go sideways, which Mary's parents clearly didn't do, emphasizing that she was an unwanted child.