The technical logic behind mining
(T.L.;D.R., the output of a randomizing algorithm is not fully random as it should be within a known range in order to be accepted, forcing the input to be guessed a little at random, as no peer knows the exact good input until they stumble upon one.)
---- 2
So how is it so difficult to create new #Bitcoin blocks that others accept? By adding a #difficulty to it. Haha. All jokes aside, the reason is because the block needs to contain a specific string of numbers that form a value. This string has to be forged from the content of the block itself via #hashing (process of randomizing binary patterns using pre-defined mathematical formula) and the result is called a hashing output or hash, in this case a blockhash: the fixed-length randomized binary output. Because all digital data is binary (including numbers), it can be hashed. In a good algorithm, the output should be completely different when changing the input 1 single bit.
This randomized output, needs to follow a certain rule in order to be valid: it must have a lower value then the consensus established maximum value. e.g. If this value is 10000, only hashing outputs from 00000 to 09999 are valid. If a hash is valid, it is included in the block as a title, called the header. Individual blocks can be identified using their corresponding unique hash AKA blockheader. So to get a random output string within a desired range of value, you need to have an input that happens to generate that particular random output, which is really unlikely on the first thousand tries. Therefore you likely have to change the input of the hashing algorithm, AKA the block, contstantly a little bit in the hopes that the resulting changing output suddenly has the right value. We can not predict the resulting value beforehand, because the hashing algorithm is designed to generate unpredictable changes in the output if the input is changed.
To verify a block, the peers just need to repeat the hashing process with the same binary input AKA block and check if they get the same resulting special hash as the creator claims in the header. If this is not the case, the header of the block is fake, because the creator of this block had to follow the same steps and thus can not produce a different hash. This is mathematically established and serves as the PROOF of work foundation.
This is just a simplified example. In the real network, the strings are quite longer and the rule it has to follow is a little more precise and also adapts over progress of block creation to the amount of hashing being performed.