In Ear Monitors I believe was originally created by J Harvey when he was working with performing artists as a way to monitor their own performance while performing. It was usually customized to the performers ears and had great noise rejection so the performers only heard their own parts rather than the entire band. Jerry went on to start and sell Ultimate Ears which marketed these designs for consumers before starting up JH Audio a few years later. Of course UE also began creating universal fit versions of IEMs.
Earphones are usually generic/universal fits from more conventional manufacturers like Sony et al.
In use, I guess there's nothing much to differentiate them except for price
These days IEMs often include the ability to handle digital crossovers and amplification (JH3A) or custom tunes (UE).
I like IEMs primarily for when I travel. My old UE11Pros are small enough to pack on trips and for long trips to the US - it means I can cut out the noisy kids and engine noise and sleep throughout. I guess for those on train commutes, it's also a good companion - plus its closed design means you won't upset the guy seated next to you.
At home tho, I prefer the use of headphones. The sound IMHO has a larger presence. But they are heavier so not as portable.