Firstly the iPhone 5 lens has to be f/2.2, due to the small pixel size, the effects of diffraction which start to creep in at f/11 on a DSLR, start to creep in at f/1.45 on a 5.6mm (diagonal) sensor!
I though that in order to have a big aperture such as f/2.2 a big amount of light should be able to enter to the sensor and in order to do it, a big lens was needed.
The figure f/2.2 actually means a large amount of light per unit area. Given the tiny sensor in the iPhone 5, this means there is still a small amount of light overall being transmitted by the lens.
An f/2.2 lens has an entrance pupil (the apparent size of the aperture when looking through the centre of the lens) whose diameter is equal to the focal length divided by 2.2
The focal length of the iPhone lens is 4.1mm so the entrance pupil is 1.86mm, which is not difficult to achieve in a small package. Compare this to a 35mm f/2.0 lens for a DSLR, which has an entrance pupil which is 17.5mm in diameter!
Aside #1: entrance pupil diameters
From the above it would seem to be the case that ultra-wides with focal lengths of 8mm and f-stops of 4.0 for large APS-C sized camera sensors should be the same size as the iPhone lens as the entrance pupil is hardly any larger. However these lenses are many, many times larger. To explain why we need to go a bit deeper into lens design.
In order to be precise I use the term "entrance pupil", instead of the "physical aperture" (the hole in the lens barrel where the iris is located). The important factor for lens performance is not how large the aperture is, but how large it appears to be from the outside world. The Canon 600mm f/4 lens has an entrance pupil that is a whopping 150mm wide! Yet the aperture itself is located in the middle of the lens where there is clearly no space for a 150mm opening.
So you might read from this that a large entrance pupil lens doesn't have to be physically large, however in order for the aperture to appear to be 150mm wide, the opening at the front of the lens has to be at least 150mm. And if you look at the Canon 600mm f/4 clear this is the case with a dinner plate sized front element!
Entrance pupil size and front element diameter are extremely well correlated for longer focal lengths, but as you get into ultrawides the correspondence stops. Our 8mm f/4.0 lens should have a tiny front element. The answer is that for a lens to be f/4.0 the physical hole in the lens that appears to be 2mm wide, must be visible from across the whole field of view, which is considerable, hence a large bulbous front element.
Due to the smaller sensor the iPhone lens has a much smaller field of view compared to it's focal length, hence the range of angles the physical aperture has to be visible from is much reduced, allowing the front element, and thus the size of the lens as a whole to be much smaller than the APS-C lens.
Aside #2: phone camera lens design
Having a small f-number like f/2.2 is not only associated with large lenses but expensive lenses also. Whilst f/2 lenses appear on some compacts, they tend to be high end models. So the obvious question is how the iPhone camera achieves a relatively large apertures at a price that is economical for inclusion in a smart phone.
The answer to this question is that the lens is made from aspherical plastic elements. Asphericals made of glass are very expensive to manufacture, however the iPhone lens is so small they can be molded from plastic, which is cheap but only works for small elements as the plastic would expand/contract too much on heating when scaled up.
The Nokia 808 PureView is the best example of this, being a five element all aspherical design, which would cost an absolute fortune to make from glass (if it were even possible with today's processes) and reportedly outresolves the Zeiss 50 f/2 (taking the image circle into account). See this link for more info, including a cross section of the lens image showing the sort of curves that DSLR lens designers can only dream of!