Not a day goes by without hearing these two terms when you are involved in cryptocurrency and blockchain technology, PoW and PoS(there is a third one that you don't hear about that much, but you will get to know it here). when you are trying to find the next best choice for investment in cryptocurrency, one of the factors that could affect your portfolio is the algorithm that the project is using(except Bitcoin which has a totally different situation). let's go through each one and see how they work.
Proof of WorkPoW(Proof of Work) algorithm mainly is based on computation power, it means you are as powerful as the number(and power) of your CPUs. This algorithm is the oldest and the most common one in blockchain technology, one of the problems that PoW has, is that if you want to mine coins, you need to have powerful devices specially made for this purpose which cost some money, and also you need to spend a great amount of electricity and bandwidth over the process of mining, the whole thing does not seem profitable and in reality that is correct(if you don't have proper equipment, you probably will spend more that you earn).
Another problem other than wasting energy is, in future when there is no coin to mine anymore, miners only get paid by transaction fees, and because the mining process is very expensive, they will accept any fees which will lead to having fewer miners and finally being prone to 51% attack(when a miner have 51% or more percent of mining power and is able to change data in blocks), another problem was that the rich would get richer because the more resource you provide the more coin you will mine.
Proof of Stake
As you see PoW is not the best algorithm for blockchain, so another algorithm was developed that works completely different and makes you powerful as your stakes, in another word the amount of the coins that you earn is related to amount of stakes that you hold, for example, if you have 10% of a coin in your account, you would earn 10% of new coins that are created in future(the concept is simplified, there are more details in technical terms) because the probability of you signing next block would be related to your amount of stake. in this case you don't need to solve very hard mathematical challenges anymore which prevents wasting many resources like electricity, and also if someone wants to own more than 51% of the stakes to do the attack, he/she has to buy 51% of the stakes which is practically impossible because when he/she starts buying all the coins, the price would go to the moon and he/she won't be able to afford all that money.
Again one problem here is the person that holds the oldest set of coins or have more, gets more(rich gets richer, the same as PoW) which is not everybody's favorite condition,the only thing that needs to be done is to prove the ownership of your stakes or the number of the coins you possess. so what should we do?! the answer is already found actually. by the way, the first coin that implemented PoS was PeerCoin(PPC).
Proof of Importance
This is where PoI comes in, because of the problems that were mentioned above, PoI algorithm came around, the idea behind this algorithm is that you are important as your activity on the network. it mean those who are active on the network and help project to benefit(loyal users) are going to be rewarded, each address(user) is given a trust score, and by activities on the network it gets higher, the higher it gets, the more chance you will have to be rewarded by the network, this way rich necessarily does not get richer and everyone has the chance to be rewarded based on loyalty and effort of the user. as I said before the whole thing is being simplified to get you a general and basic understanding, it has more technical complexity in it, though.
the coin that is using this algorithm is called NEM(XEM) which is one of the promising coins for long-term investment exactly because of this well thought algorithm.