How to explain the steps in the implementation of hashing functions like SHA1 I was reading the article about the SHA1 hashing function (I know it is not secure anymore) and I've found a pseudocode implementation on Wikipedia.

I can see that there are a lot of mathematical operations, and what I wanted to know is the justification of each step in this hashing function. I want to know, for example, how each part increases the security of the function. How do we know that these operations are gonna produce a drastic change in the output when a minimum change is made in the input?

Is there a book about the theory behind hashing function? Maybe a book that explains mathematical functions or operations that maps the input to a very large output space such that is very hard to do the inverse way.

Is there a very simple hashing function that can be studied and that are examples of attacks? Is there some paper that explains the evolution of these functions and the justification for some math operations in this?
I recommend you spend some time with some crypto textbooks, in particular the Handbook of Applied Cryptography and Antoine Joux's Algorithmic Cryptanalysis.  They explain some of the details of hash functions.  You might also try reading some of the questions on Crypto.SE; there's a lot written there.

In addition, do some self-study about unbalanced Feistel networks.  They are part of the core of SHA1.  You can find information about them on Wikipedia and in the cryptographic literature.

You might also like to read the submissions to the SHA3 competition.  Every one came with a detailed technical document that explains the design criteria and security analysis of the hash function.