Maths has two different types of algorithms, linear and non linear.
Linear algorithms follow rules such as for addition:
As input x gets bigger and output y gets bigger, output z will get bigger.
The other type of algorithm is non linear for example taking the remainder after a decimal:
Regardless of the size of the input, we know the output will be between 0 or 1.
The sha algorithm uses blocks that are of the same size and runs a function on each pair of bits to return either a 0 or a 1 as an output for each bit. This is essentially the mathematical problem being solved.