You’re looking to trade your old iPad or iPhone, but you've read horror stories of how doing a factory reset may not completely wipe your information... but this is something you shouldn’t have to worry about.
Although it isn’t technically impossible to recover data from an iOS device, the sheer difficulty and resources required to do so means that unless someone knows there is something specifically valuable to them, then it not worth the effort.
The encryption that is found on Apple devices is so sophisticated that the chances of cracking it is so remote that even Apple wouldn’t suggest you take any further steps than using the ‘Erase all content and settings’ function. Let’s face it, if Apple’s ‘Erase all content and settings’ function was leaving their devices at risk then you would have heard a lot more about it beyond a few rumours in the net.
There are further security measures that can be taken to further secure your data by overwriting all memory with random data, but unless you have some juicy state secrets then it’s not worth the bother! So breathe easy :)
If you want some more in depth technical knowledge of how Apple protects data on their iOS devices them give this a read.