The hash of a block is not simply a unique string; rather, it is a unique string generated using a hashing function.
A hashing function is a one-way encryption algorithm that cannot be reversed. Due to this, in order to generate a desired output, you have no choice but to modify your desired input over and over until you find one that works.
This is the process of mining, where computers (1) take transaction data, (2) modify a small part of it, called the nonce (they cannot modify any other part without the block becoming invalid) and (3) generate billions of hashes per second in an attempt to find a given noncesmall modification that, taken in conjunction with the rest of the transaction data, will generate a hash with X amount of zeros.
Now that the hash has been generated, the full transaction data along with the nonce can be submitted to the BTC network. Although it took an unfathomable number of tries to find the correct nonce - to "reverse" the one-way hashing function, it is trivial to verify it by simply passing it and the transaction data through the hashing function.