This is a pencil holder for Apple's 1st generation Apple Pencils that you can't attach to your Apple device. The small container is there for you to put your pen capsule in when charging so you don't lose it.
I would suggest you add some rubber coating on the holder so your Apple Pen doesn't slip. (see image above)