What is mining?
Ethereums mining process is almost the same as bitcoins.
For each block of transactions, miners use computers to repeatedly and very quickly guess answers to a puzzle until one of them completes.
More specifically, the miners will run the block's unique header metadata (including timestamp and software version) through a hash function (which will return a fixed-length, scrambled string of numbers and letters that looks random), only changing the 'nonce value', which impacts the resulting hash value.
If the miner finds a hash that matches the current target, the miner will be awarded ether and broadcast the block across the network for each node to validate and add to their own copy of the ledger. If miner B finds the hash, miner A will stop work on the current block and repeat the process for the next block.