The heat coming from your stove denatures the protein by disrupting some of its bonds that held the molecule into shape. In the case of hard-boiled eggs, the proteins clump together and solidify, causing the egg white and yolk to harden.