The reality is anyone who is listening through free Apple earbuds shouldn't be concerned with the quality of the sound to begin with. Especially if they are streaming music via Apple Music, or otherwise (interesting side note, Neil Young just pulled his music from streaming services because he said the quality wasn't high enough). However as fisher king writes, a higher quality DAC is better regardless if the quality is necessarily apparent to a specific listeners anecdotal experience.
As Mindinversion states, there are a lot of headphone options. One in particular is the Phillips Fidelio which has gotten very high marks for it's sound quality with it's built-in DACs. These are the style of headphones people will be using anyway if they prefer quality audio. This is evidenced at my gym where a good 60% of the headphones worn are of the full-sized Beats or better variety, with the rest being earbuds of BluTooth.
The 1/8" audio jack is a low-fi interface, and any Apple product is going to provide good basic performance, superior to almost any other manufacturer in my experience, depending on the final listening source: speakers, headphones, earbuds, etc. Higher quality headphones are likely to show up deficiencies in both the DAC and audio file quality.
So it's not a simple question of which sounds better, since there are so many variables depending on how critical the listening environment is, the most important of which being the individual's own ears.
In the end, regardless of the device used, if a good quality external DAC is used, either built-in to the headphones, or a dongle for a good quality pair of headphones, the bet quality possible from the chosen soundless will be possible. And that dongle doesn't have to be very big at all -- Apple's own Lightning Dock has a tiny footprint yet outputs audio from it's 1/8" audio jack equal or superior to the iPhone's built-in 1/8" jack. All the more reason Apple should just move away from the 1/8" audio jack, and let the consumer chose the best method for getting audio out of their devices, not just the lowest-common demeanor standard.
Whoa there. Slow down. Lot's of misinformation here. The 1/8" audio jack is NOT a 'low-fi interface'. It is merely the interface that transfers the analogue signal from the DAC to the drivers that will ultimately make the sound. If the 1/8" jack is low-fi, then so are the speaker jacks in an expensive home system.
To say it again, the DAC's and amplifiers Apple has been using in their devices, from iPhones to iPads to their MacBooks and home computers have been extremely high quality, and more importantly, extremely well implemented for MANY years now. It is extremely unlikely that the DAC in some inexpensive Philips headphones is any better, and in all likelihood it is considerably worse.
The Lightning jack doesn't really output audio at all. It is capable of passing the digital bits and handing it off to an outboard DAC, but it doesn't output anything analogue that you can listen to directly. Whether the output sounds the better, worse, or the same as what comes out of the 1/8" jack is entirely dependent on what you connect to that lightning jack. The Lightning dock almost certainly uses the same cheap DAC as is tucked into the Lightning to 30-pin adapter, and that sounds, to my ears, tested on several extremely expensive systems, considerably worse than the output direct from the iPhone.
In order to play sound on a speaker, the sound must be converted to an analogue waveform, and all the 1/8" jack is doing is passing that waveform to the headphones. Any sound system has the same bit of copper somewhere in the chain - whether as an 1/8" jack, speaker terminals, or a tiny piece of wire connecting the output of the DAC (remember that's Digital to Analogue Converter) to the headphones drivers directly. No one system is better than another. It's merely a question of the right part for the job.