Viewing distance and image size play into this too. Consider a billboard, which can get away with a 2MP or less resolution due to the viewing distances. There's a diminishing point of returns when it comes to pixel count. At some point, you'll not notice the increased pixel count, but image quality can start to suffer. For large prints, you could easily get away with the 10MP setting unless you expect someone to get right up against the photo.
What would the 40MP setting be good for on such a small sensor? Cropping and zooming. If the lighting is good enough, you'll be able to photograph things further away and use digital zoom up to 2x and have the same pixel count as the full area 10MP image (remember that pixels are grouped as 2x2, hence 40MP reduced by 50% is 10MP). Your friend using it for food may be doing so to attempt capturing all the different textures. In ideal lighting, that could work, but hard to tell without seeing the photos and how the scene was lit.
That is, of course, assuming such a tiny lens can actually resolve that many pixels. Even on larger lenses like DSLR's, with much larger sensors and pixels, they still have trouble showing the full detail of these super high pixel counts. Anymore, it's basically a bragging rights game and little else.