In any more modern system, you use a different component or subsystem for each. iPhone 5 is a pretty old example and speaker technology has come a LONG way in phones. These days, you're driving watts of power into your phone speakers, any headphones driven with that much power wouldn't last very long.
Even very high end headphone amplifiers (external, chunky ones) tend to be rated for around 1W max. Typical is much lower, in the 100mW or less range. Either way, you aren't listening at that high of power unless you want hearing damage.