The difference between camera and headphones is that the latter consume useful space inside and extra lenses for camera do not. Probably it also has to do something with new waterproof feature (different design of case, more holes to secure etc).
iPhone 7 camera was improved, but additional components add to its thickness much more than to width and height. Jack consumes width and height, that are big enough for one extra chip, for example.