I would not agree with the general statement that IEMs have good soundstage, but they have the potential to. There are many phenomena that contribute to the sensation of soundstage or "space" within a recording apart from how it is produced. The very nature of drivers in your ear canal almost entirely negate interaction/reflections of sound with your pinna/body and other things in a typical room that could contribute to this effect.
However, one of the most significant things that contribute to giving a good or more natural sounding soundstage is frequency response, which is something that is well represented with the Harman studies (Harman curve for headphones). So despite the fact IEMs may not have the advantages of speakers or headphones in creating soundstage with more "natural" auditory/spatial cues, they can still be tuned to a favourable curve and this is sometimes easier to do with IEMs, especially in the bass/lower midrange region due to occlusion of the ear canal. Compliance to a desirable curve in the lower octaves is extremely important when it comes to reproducing good soundstage, and most IEMs are not bass/midrange shy. So all of this means that it is very possible to have a better illusion of soundstage (in some aspects) with well tuned IEMs compared to poorly tuned headphones or even speakers because of the frequency response alone, even if all the other auditory cues are entirely absent.
I would say for the most part, people that report good soundstage with IEMs either a) just happen to be listening to well-produced recordings that have good, innate auditory soundstage cues within the content that work well with the isolation of the IEMs (much of the soundstage effect can come from the music itself) b) the IEM's frequency response is close to an ideal general response like Harman curve for example c) the IEMs frequency response is coincidentally close the the individual's ideal based on their own individual HRTF/canal anatomy