What causes eyes to get heavy when you are tired?

They tire as well. When you are tired, your eyelids want to close so that you can sleep. The heavy sensation comes from your attempt to fight the urge to keep your eyes closed.
Eyelid reflex. The eyelid muscles react to your need for 'shut eye' by closing when you are physically tired. You can try to counteract this by trying to stay alert, splashing cold water on your face, etc.