Playing peek-a-boo with a baby is entertaining for more than just the kid factor that goes with it. You see, the baby really does believe you're disappearing when you hide your face. That's why the baby laughs, because to the little tyke, it's as if you are invincible even though you know you're right in front of their face. How is this possible? Why can't a baby "see" you even though you're right in front of them? It's simple!
Babies don't understand the concept of object permanence. Object permanence is the knowledge that an object is still there even if you can't see it. For example, close your eyes. It's dark, right? Well, you can't see anything in front of you, but that doesn't mean that it's not there. It's still there, and if you feel around you can confirm that. However, to a baby, who has no understanding of this concept, when you disappear from their site, whether it's behind your own hands or just standing behind a closed door, you really do disappear from their sight.
So, when a baby closes there eyes, they are basically in a void. They don't realize it's a void, and they think it's natural, because they don't have higher brain function just yet. They'll grow out of it as they get older, but it'll take time for the laughter of peek-a-boo to die down. They'll keep laughing until they're about one to one and a half years old, by then, the basics of object permanence will begin to grow in their brains. We all know that once they hit puberty, chances are they won't even remember playing peek-a-boo at all, which is why that growth and learning is essential to their understanding of how the world works.
As the baby grows older, keep in mind that they slowly begin to grow out of that as their knowledge of object permanence grows and they begin to understand that just because something disappears that doesn't mean it's really disappeared. Eventually as they grow older, they won't even think about it and peek-a-boo will be boring to them, because they know where you are, you're right behind your own hands. The laughter will stop and the baby will have begun to grow into a beautiful little child curious about the world but still not understanding everything in it.