From what I've read on the camera, the main lense takes a normal photo. The second camera takes its own image, and by comparing the two it can calculate depth in the image. The second photo is deleted, but the depth information is stored alongside the main image. Then when you load up the image editing software and choose where to 'focus', the software instead cheats by blurring everything but the stuff at a specific depth.
Other companies like Nokia and Samsung have their own versions of this, apparently, but they instead just take multiple images at different planes of focus and you can later choose which one you want. That technique would take up significantly more storage for images, but you really do end up with an image that was focused on the object you wanted, rather than a partially blurred image.