Encryption is the process of transforming information (referred to as plaintext) into a form (ciphertext) that cannot be easily understood by unauthorized parties. Encryption does not of course replace the need for physical security, such as locked doors and encrypted doors.
Encryption algorithms are used to convert data from its original (clear) form to a scrambled code that can only be read by someone possessing special knowledge, usually referred to as a key. In order to understand what is encryption is, you should know that it is the process of converting normal text into unreadable code form. It is used to protect sensitive information like passwords, credit card numbers, and other personal details.
For example, if an attacker steals all your data in clear form then they can easily identify your password and login as you on the Internet banking or social media sites. But if they steal your data in encrypted form then they cannot do anything with it unless they have access to your private key which only you have access to.