Are spells which don't require attack rolls sentient? Can spells tell illusions just by 'looking'? How come the images don't fool spells with a save but they can fool those with an attack roll?
On one level, the answer is "because the rules say so". They do. The rules do say so.
But that doesn't explain the concept. That can be unsatisfactory.
So here is the concept: spells which target one or more individuals (as opposed to AoE) usually require 'a target that you can see'. Some of those require attack rolls, some don't.
Spells that don't require attack rolls simply do not need to be precisely aimed! All that is required of magic missile, hold person, phantasmal killer and lots, lots of other spells is that the caster of the spell can see the target creature. The caster is not aiming the spell like a sniper aims a rifle, he just knows who he wants to affect. That's all the caster needs to do.
DM: There is a group of five baddies; who are you casting hold person at?
Caster: The guy in the green hat.
That's all that's needed!
But for some spells, more precise targetting is needed. Those are the one's that require an attack roll. Those are the ones that are bothered by enemies standing too close and disrupting your precise aim and imposing disadvantage on the attack roll, while the caster of hold person/magic missile is totally unaffected by such jostling because he doesn't need to aim those spells, just know who he wants to affect.
DM: There is a group of five baddies; who are you casting fire bolt at?
Caster: The guy in the green hat.
DM: The guy has cover from you so that's +2 to his AC, and the massive orc barbarian stroking his greataxe right next to you(!) gives you disadvantage to your attack roll.
Mirror image is, and looks like, one guy with several copies of himself swimming in and out of each other in the same 5 foot space. Can you see the creature you want to cast hold person at? Yes, he's right there, him with the images! All that is required is that you know who you want to affect and that you can see who you want to affect.
But if you want and need to precisely aim at the target (because the spell requires an attack roll) then just knowing who you want to target isn't enough; you have to aim at the correct image. In game mechanics, you target the creature itself just by knowing which creature you want to affect (and the images don't and cannot interfere with that part), but the power of mirror image is that the spell itself has the ability to switch the incoming spell's target to an illusory image.
BTW, if you are lucky enough to have a DM who lets you get hold of an artifact level magic sword whose power means that it automatically hits the target without an attack roll, then that would bypass the images too! The fighter would just swing the sword at the group of images and the power of the sword would mean that this would be enough to strike the creature and ignore the images. Still, I've never heard of such a magic sword in any D&D campaign for nearly forty years so I thing we're safe, but the concept remains sound.
But what if the target isn't a valid target? Eldritch blast, magic missile etc. can only target creatures, not objects or illusions! Does that mean that you can aim at a chest with one of these spells and if the spell fails to materialise then the spell is now a magic mimic-detector?
No. The spell is cast normally, but doesn't affect an invalid target.
If you cast eldritch blast at what may be a chest or may be a mimic, it's not that the the spell fails to materialise if it's a chest, it's that the beams don't affect a chest at all; the beams only affect creatures.
When you cast magic missile 3 (or more) missiles appear and then streak toward the target(s). If the target is invalid it doesn't mean that the missile never appeared in the first place or that it refuses to streak toward the target because the missile 'knows' that the target is not a creature. No, the missile streaks towards the target as normal, but has no effect if it is not a valid target.