The science of ciphers and encryption, a specific branch of mathematics
Clever minds created and are subsequently improving encryption algorithms.
Nowadays, we have a set of symmetric and asymmetric (a.k.a. public-key cryptography) ciphers at our disposal for the use in different areas of life. Actually, encryption is all around us - you may not notice it, but it's quite possible that you use it every day.
You download your e-mails from the mail server with the IMAP protocol through a SSL/TLS encrypted connection. You pay at your preferred coffee shop with your credit card - the payment is authorized through the vendor to the payment processor through exchange of encrypted information, so no contents of the transaction are leaked in transit. Or perhaps you only surf the web and log into any service, whether it is your web-mail, your internet banking, or your phone operator client admin website. All these use HTTPS for securing your login credentials and the content transferred afterwards. HTTPS uses SSL/TLS encryption technology to secure the data you enter and to ensure that it can't be read during the transmission, but only by the destination party. It's ... encrypted!
Remember that Cryptography, the art of encrypting, allows us to encrypt even our email messages. You may want to take a look at this post, which explains more securing your mails.
You can actually completely encrypt your smartphone, too. Read this post please, to make sure you use best practices to secure your endpoint.