So each Cryptocurrency has one of two methods to verify transactions. Proof-of-Work and Proof-of-Stake.
Proof-of-Work (PoW) was brought over to the money world by Hal Finney in 2004. And when Bitcoin was introduced in 2009 it was the first widely adopted application of Proof-of-Work.
Let's look at Bitcoin and it's use of the Proof-of-Work. Bitcoin has a ledger which is public and distributed worldwide. The point is that in case a altered version of the ledger gets created it won't be accepted because the whole world is sharing a different ledger.
Now in this ledger it contains a record of every bitcoin transactions which are arranged into sequential blocks. Now the Proof-of-Work comes into play. It is the process of a computer trying to figure out a given set of data through a hashing function. Bitcoin uses SHA-256 hashing function. Now for modern computers or even phones trying to figure out the hash would be extremely easy and quick so in Bitcoin a difficulty is applied to the hashing to make it harder and require more and more computing power to figure it out.
So people put their computing power into Pools. Which are just a bunch of people using their computers together to be able to 'mine' quicker. About every 10 minutes a block is mined. A single block can hold thousands of transaction and many bitcoins being moved back and forth. So once a mining pool figures out the hash that works, it gets sent to all Bitcoin nodes in the network and the Ledger gets updated.
Think about it this way.. Say for example there are 1 million possible hash outputs for a block. And say a mining pool of 1,000 computers is able to guess/mine 500,000 hash outputs in a 10 minute period. My 1 computer can mine/guess 100 hash outputs in a 10 minute period. There is no guarantee that the mining pool will solve it first. I and my 1 computer could guess the hash first and win the bitcoin fee. So it is random and more like a lottery but if you own more tickets to the lottery you have a better change at winning then someone with just 1 ticket. So it is almost always better to join a pool to Mine Cryptocurrency.
Proof-of-Stake (PoS) was created as an alternative to Proof-of-Work. It was created to address a few possible issues with Proof-of-Work. PoS sets a limit to the amount of a certain coin you can mine. So if you own 5% of all Tezos coins you can theoretically mine only 5% of the blocks. Think of PoS as a savings account where you earn interest.
PoS was mainly created to fix 1 issue that could arise down the road for PoW coins. As bigger mining pools are created and they have more and more computing power if they have 51% of the computing power of the miners they could attack the network by creating altered blocks that give themselves bitcoins that are not there's. But since they own 51% they are the major validator to the network and what they say would go. Now for Proof-of-Stake in order to have control of 51% of the mining power you would have to physically own 51% of the coins in that ledger. It would make zero sense to attack the network that you control the majority of.
It is possible for a currency to use a mixture of both protocols and there are different variations of these. But general rule of thumb is that you can either mine or stake a coin.