The advantage for portable use is that IEMs fit in pockets, while portable headphones don't. No portable headphone fits in a pocket and sometimes that's exactly what needs to be able to happen because sometimes you don't want to have it just hanging around your neck and you don't have a pack with you. That's where IEMs come in because they have that "stuff it in your pocket" capability. That said, in a price bracket comparison of headphones vs IEMs, the headphones would win. You have to go pretty high up the IEM price ladder to get something that matches in quality compared to a headphone. I do really like IEMs though; a good one delivers great sound quality without having to have a full headphone on (which as a person with glasses, there are times when I don't feel like having a headphone on).
My current headphone-friendly environment currently has speakers so that's what gets chosen more often than not
. Part of that has to do with glasses and the fact that having them means overear headphones are
a tad more uncomfortable. But I'm in agreement, given a nice set of headphones and my current favorite IEM (JH16 Pro FP), I'd likely pick the headphone.