When miners are mining, what calculations are their computers actually doing?

Are curious as to what purpose the calculations have, or what the calculations actually are, mathematically?

The purpose is to secure the network, the mathematical calculation is a SHA 256 hash (2 rounds of it, I believe) that must result in a low enough hash-value to meet the difficulty.