Thanks... Very much for the explanation. i am little confused cause its hard to understand. can you explain by simple words
In what ways? Is there something you're more familiar with I could use?
Whenever someone wants to spend bitcoin they must generate a transaction and share it with nodes (most miners then collect information from nodes to mine them and confirm the transaction).
Hashing is performed on the transaction to get a txid (which you might be familiar with). A hash is a form of compression algorithm - you could imagine it like a remainder function if you don't want to go on a deep dive through the workings of the algorithm (sha256).
Once this transaction is made it must be shared with others, these others are nodes that act as the backbone of the network as they facilitate data sharing.
Miners then collect these transactions together in "blocks" and form merkle trees. The root of this tree with other information like a timestamp is then hashed to make the blockhash which is then tested to see if it's below a certain number. (finding a diagram of a merkle root tree or an explanation is likely better than me explaining it).
The mining target is hard to work out because of the way the algorithm works. If you needed to find a number close to 2 and the function was 256667 % 59 (where % is the remainder function, 59 is a coefficient and 256667 as a number set by the algorithm - this might be a bad example as a remainder function is still fairly linear but it's easier to explain than sha256). Most of this is done by ASICs (algorithm specific integrated circuits) as sha256 is an algorithm that can be programmed onto a chip.
Once these blocks are found they're sent to a node where they're then distributed to other nodes. All nodes need to share with each other is their current block height and the hash of the last block to see if there's anything new they need to listen out for.
There are other messages nodes send to others such as a list of peers they're connected to so the other node is able to connect to them.
Nodes have their own consensus rules too that can be modified by whoever is running them (or the node itself algorithmically - this is done for things like mining difficulty which is set as an average of the hashrate over the past 2 weeks worth of blocks: every 2016 blocks).
Blocks are targeted to be found at an average interval of 10 minutes but it works as an average as sometimes it can take over an hour for a block to be found and at other times two blocks can be found fairly close together. As the nature of how a block is found is random (meaning it's hard to predict when it will be found) and spontaneous (meaning it can't be predicted who finds it) there are no advantages for doing things like finding empty blocks vs full blocks (except full blocks have higher rewards due to incorporating transactions and taking their fees).
Transaction fees and block rewards are both paid to the miners of a block. Pools function as a large collection of miners and share their reward when they find one (the pool operator also takes a fee from this though).