Many encryption schemes are based on Public Key Encryption, or PKI. This form of encryption is based on complex mathematics, but the basic principal is quite simple: Everybody has two Keys.
Read on for the details of how Public Key Encryption works.