This is truly an incredible film that seems only to offer more to the attentive watcher every time it is watched. Essentially, we have two planes of reality that intersect each other. We have the grim reality of the Spanish Civil War and then the separate reality of the young girl, Ofelia, who is struggling to accept the realities of her life and her mother's marriage to a very dangerous and violent individual. Her internalisation of the challenges she faces creates a glorious and fantastical world where she has to symbolically achieve maturity through passing a series of tests to achieve the escape she so desperately desires. Each of these three tests can be considered in its own light as a symbol of the maturing of Ofelia.
If we consider the first test, which involves retrieving a key from an enormous toad, it is no accident that Ofelia has to retrieve this key when she is supposed to be presented to friends of her new step-father in a pretty dress. Of course, retrieving the key inevitably means that she does not attend and she ruins her new dress. We can see this as a very important symbol of defiance as Ofelia asserts her own individuality and refuses to bow the knee to the imperious demands of her new step-father. You might like to consider the other challenges she faces in a similar light. All of them involve testing as she seeks to mature and develop.