In hash, you can't get the actual data back
For Example: If your data is hashed, then you can't get the actual data back, so to compare if the data which you have now is same as the data which is already present, then hash the present data and compare only the hashed data, since you can't retrieve the original data.
Original data: SUNSHINE
hashed data 1: q345gjseiwueiwjr39
Present data: SUNSHINE
Hashed data 2: q345gjseiwueiwjr39
Since hashed data 1 == hashed data 2 it is equal
Where in the case of Encryption, you can get the data back
For example: You will have some encryption algorithm to encrypt the data so that your data is protected
For storing the password in a database or somewhere where you think the data should not be retrieved by anyone go for hashing
But if you want to retrieve your data like Card No or something which have to be protected but retrieved back then go for encryption.