Data encryption works by using algorithms to transform readable data into an unreadable format, known as ciphertext. Only those with the correct decryption key can convert the ciphertext back into its original, readable form. This ensures that even if data is intercepted, it cannot be understood or misused by unauthorized parties.