Apple designed iOS devices so that the hardware that encrypts data is in the path the data travels when it moves from flash storage to the iPhone’s main memory. This means that data can be automatically decrypted when read from flash into memory and re-encrypted when saved from memory back to flash. On the iPhone, encryption is essentially free.
I don’t think many people understand how strongly your data is protected by your iPhone’s four digit PIN. Since the 3GS, itt isn’t just an artificial software barrier to stop nearby prying eyes.
Your PIN protects your data as well as access to your device. Until your PIN is entered, the data on your device is encrypted and unreadable.
However, as every possible four-digit combination can be brute-forced in under 15 minutes, the premise of encryption is only superficial, when using the default PIN code lock. If you want true security for your data, go into your Passcode Lock settings and choose an alphanumeric string.1 It only takes a seven character password to make brute-forcing take several years.
1 You have to disable “Simple Passcode”.