Start with a simple cipher. Shift every letter 3 places along the alphabet: A becomes D, B becomes E, and X, Y, Z wrap round to A, B, C. 'MEET AT NOON' becomes 'PHHW DW QRRQ'. The rule, shift the letters, is the method; the number 3 is the key. Anyone who sees 'PHHW DW QRRQ' sees nonsense, but your friend, who knows the key, shifts each letter back 3 and reads the message.
A shift cipher is easy to break, because there are only 25 useful keys to try. Real encryption, like the AES method built into phones and laptops, follows the same idea of a method plus a secret key, but its keys are 128 bits or longer. That gives so many possible keys that trying them all would take billions of years even with the fastest computers. This is why encrypted data counts as unreadable without the key, not merely hard to read.
Encryption is not the same as hiding or locking. A password on a shared folder stops people opening it through the normal app, but the files underneath may still be readable to anyone who copies the disk; encrypted files are scrambled, so a copy is useless without the key. Encryption is also not all of security: if a fake email tricks you into typing your password, the attacker logs in as you, and the app decrypts everything for them.
Think of it like this. Encryption is like sending a message in a locked box that anyone can carry but only the key holder can open: the postman, a thief or a nosy neighbour can hold the box and learn nothing. The comparison fails in one useful way: a real box can be smashed open, while strong encryption cannot be forced in any practical amount of time.
Core idea. Encryption protects confidentiality by making data unreadable without the correct key.