I have seen this happening more than once. While I don't know the whole theory behind it, each time it happened, there was something just below the hole, let's call it "the lump".
What I think happens is that the lump is too heavy. When the batter below it tries to rise, it doesn't have the strength to push up the lump. This could be combined with differences in heat transfer throughout the batter vs. on the batter-lump transition in preventing rising (I am certain they exist, but I don't know whether they have an effect at all). The result is a hole where the batter didn't rise, surrounded by nicely risen batter.
As to where the lump comes from: you say "chocolate and pear cake". If you have pear pieces in the batter, right under the surface, they can do this. I have certainly seen it happen when the recipe includes fruit pieces in the batter. If there are no pear pieces, my second guess is badly dissolved flour. The directions for this type of cake normally include folding the whites very gently, and generally erring on the side of too little whisking. This could contribute to uneven batter texture, resulting in lumps.
In the second case, the cake may have some less-than-pleasant pieces, but will still be mostly good. If it is fruit, the holes are purely a cosmetic problem. So not much harm done either way, unless you are shooting for a prize at a baking competition.