Because it mimics what he is just coming to understand about the world: that objects and people still exist even when he can't see them (a jack-in-the-box is fun right now, too). That's why he finds quick appearances and disappearances amusing.

Understanding this concept, also known as object permanence, is an important milestone your baby reaches usually after the age of 4 months. It signals that your baby is making leaps in cognitive development – in his memory and his ability to think abstractly.