Encryption protects data by converting it into a coded format that can only be accessed by authorized users with the decryption key. It ensures that even if data is intercepted, it remains unreadable to unauthorized parties.