Neither headphones nor IEMs have anything that can be accurately described as soundstage, they are both transducers placed very close to the ear. The question arises from the degree of proximity to the eardrum, which introduces challenges at the design phase because of how psychoacoustics and HRTF works.
The best way to listen to anything is through speakers. Audio engineers use speakers to mix on and speakers take your unique physiology into account the most, so when the speakers and room are tuned right, they'll sound perfect to many different people at once.
Headphones introduce the problem of skipping past much of your HRTF, so the engineers designing the headphone have to guess at a generic HRTF that may not match up to you. Over-ears still take your pinna and ear canal into account, so generally headphones narrow the market by a manageable margin. You may have to EQ a bit to account for your torso and skull's FR as well as use a crossfeeder to account for your specific time delay and phase shift, but it's generally not that bad.
IEMs skip just about everything physiological that makes sound unique to you. Engineers have to assume everything about your HRTF outside of most of your ear canal depending on how deep in the canal they seat, so the experience we get with IEMs is significantly varied. A couple of peaks and valleys in the pinna gain region can mean the difference between a perfect IEM for one person and an IEM that sounds okay but has wonky instrument placement and odd imaging for the next.
IMO, there are a couple of ways to go about getting a good IEM for you. You either buy and sell IEMs while watching reviews trying them all the while to get a good idea what your preferred FR is, then buy the best IEM you can find/want/afford/whatever, or you buy an IEM that is very technically capable and learn how to EQ using an audible spectrum diagram to figure out how to fix soundstaging errors and fix the FR up until you are happy with it. Until HRTF becomes easier to measure, this is where we are at in my estimation.