Custard thickens due to the gradual heating of the egg proteins, which bond together as they heat up. This process happens at a lower temperature than boiling and ensures a smooth texture.