The ending is supposedly happy, with Ofelia being reunited with her real parents (the rulers of the underworld)... by dying. Mercedes holding her dead body while singing a lullaby is just icing on the tearcakes.
Of course, it could be worse, since there's another way to interpret the ending. No one but Ofelia ever saw any of the magic, so it could be that she made the whole thing up in her head to deal with her horrible situation, and the "reuniting" is just her final, dying hallucination. But that puts the whole thing squarely in Downer Ending territory.
Let's be honest here - just thinking of Mercedes' hummed nursery rhyme is enough to get a person who's seen the movie teary-eyed.
Which ties into a Harsher in Hindsight - Ofelia's death scene is sad enough, but earlier in the movie, she'd begged Mercedes to take her along when she fled, which she finally did. But when trying to dissuade Ofelia, Mercedes had promised to come back for her.
This troper finds Dr. Ferreiro's death particularly sobering. Especially for how understated it is. After granting a mercy kill to a tortured prisoner, He quite plainly knew the captain was going to kill him. His short speech to Vidal, and then walking out was a quietly dignified and heart-breaking death.
Carmen's Death by Childbirth and her funeral. Imagine how Ofelia felt all alone with only Captain Vidal for a parent.