Proof of Stake or PoS is similar to Proof of Work (PoW) except that here instead of miners we have validators.
PoS is environment friendly. In PoW the more CPU cycle you waste will determine your chances of successfully mining a block. However in PoS, it is replaced by cryptocurrency.
The validator who owns more cryptocurrency will have a higher chance to sign a block as valid and earn rewards. For example, if you own 5% of the bitcoins, you can mine 5% of the blocks.
Some networks also employ coinage to determine the stake. Coinage is the age of cryptocurrency, ie, the amount of cryptocurrency multiplied by the number of days the currency has been held in the network.
So instead of counting CPUs and GPUs, we count how much money (as in cryptocurrency) the validator has in the blockchain network.
This is because of the thinking that if you have a lot of money in the blockchain you would try to make the network more secure instead of harming the network. You would not harm the network because you have money invested in it.
Suppose there is a block that needs to be generated and there are 6 validators. Each of these 6 validator deposit their money to get the chance or opportunity to validate or sign the block.
The validator with highest stake has a greater chance to sign and verify the block. After some random calculations validator with the largest stake gets to sign the block. The rewarded is through transaction fees.
Also there are algorithms that are being developed and implemented where validators will have to deposit a certain amount of money in order to participate in the validation process. If he or she validates a false block, it will result in loss of a substantial amount from the deposit.
Proof of stake makes the 51% attack virtually impossible. Suppose there are 100 nodes in the network, the bad actor must control a minimum of 51 nodes in order to implement an attack to cause a failure in the network.
In Proof of Work, this is done by having more computing power than the other 51% of the network. Now that is a very large energy expense.
However, in Proof of Stake, it would mean having ownership of a minimum of 51% of the currency of the entire network which is very very difficult and virtually impossible.
Between PoW and PoS, the later is more stable and secure.
The consensus mechanisms that I have just discussed is a vital feature of a blockchain ecosystem. These mechanisms ensure that all the participants are on the same page and this enables the network to keep functioning even if certain members fail.