Just learned this recently, and I believe it was on this site. Heating the bolt makes it want to expand, and because it's constricted by whatever surrounds it, it expands in the direction of least constriction, usually length. Once it's cooled it shrinks slightly. Repeated heating and cooling...