It is a fact that cats are the ultimate zen masters. Whenever they get into that most concentrated, chill headspace, it is not easy to get them out of it. You can poke them, speak to them, pet them, and still, they be chill. They're hard at work, contemplating reality and deep philosophical questions. It would be a privilege to get into that cat's head and see the secrets of the universe.
Since we can't do that though, we use this moment of contemplation and show our own mental prowess by placing things on our cats' heads. It's one of the most silly and amusing things in the world. When they look you in the eye with that pen on their heads - that's one of the moments that you can really see what they're thinking, and it's something along the lines of: "fine, human, I will allow you this moment of entertainment, but you better give me a treat after."