All they do is create billions of SHA-256 hashes per second. They try to create a hash that starts with a certain number of leading zeroes. The bigger the amount of zeroes, the harder it becomes. It's basically the same as rolling dice and trying to get a sum smaller than X.
But the dice have many sides and they roll a lot of them.