Mary's confession reinforces the importance of secrets within the logic of the novel. Sharing the existence of the secret garden's door with Colin, and the fact that she'd already been in, allows her to help Colin feel as though he's a valuable person in his own right, while it shows both of them the power of being honest.