A hash function takes any input and returns a fixed-length string. Feed it the same file twice and you get the same result; change one character and the result is unrecognisable. You cannot run it backwards to recover the input.
Chains use hashes everywhere: to link blocks, to build a merkle-tree, to derive a crypto-address from a public-key, and as the puzzle in proof-of-work. A txid is simply the hash of your transaction.
Example: SHA-256 always returns 64 hexadecimal characters. Hashing "trade" and "trades" produces two strings with no visible relationship, which is exactly the property that makes tampering with history detectable.
Related: proof-of-work, merkle-tree, txid, public-key