I have some basic understanding of how hash functions work, however, I have no idea of how mathematicians created them.
Were them a byproduct of a non cryptografics related research or were them a result of a desire to find them?
Is there some sort of "standard method" for finding such functions?
I have to admit that I am not super familiar with the history. Nevertheless, it seems to me that one of the earlier important instance of a "hash function" in mathematics comes from Godel Numbering. It also gives a "standard" hash function. While this function creates numbers which are probably too large to be used in computer applications it is nonetheless important theoretically. Basically, you can take your key and send it to a product of primes and use the uniqueness of prime factorizations to recover it. The Wikipedia article I linked is pretty clear and well written if you want to read more.