The process of hard-boiling an egg involves denaturation. During this process, the amino acid chains found in the proteins in the egg are altered from their original, raw egg state, with the denaturation temperature varying somewhat depending on the specific protein in question.
image/source: Today I Found Out
It has to do with the proteins within the egg that aggregate and coagulate together with the continuous application of heat.
But in a nutshell, adding heat to these proteins initially causes the proteins to partially unfold or otherwise change their normal organized spatial structure. As this is happening, the proteins begin to aggregate and coagulate together.
As heat continues to be applied, additional bonds are formed in these clusters, creating a relatively dense protein network, which in turn results in the rubbery egg whites and solidified yolk you find in hard-boiled eggs.