Minor Illusion and Major Image have the following paragraph (slight differences in the last sentence, to include the additional features of Major Image.
Physical interaction with the image reveals it to be an illusion, because things can pass through it. A creature that uses its action to examine the image can determine that it is an illusion with a successful Intelligence (Investigation) check against your spell save DC. If a creature discerns the illusion for what it is, the illusion becomes faint to the creature.
So, there are two ways to look through an illusion:
- If anything physically interacts with the image, it is revealed as an Illusion (automatically)
- If a creature uses its action and succeeds on a Intelligence (Investigation) check
What are fair ways for the GM to interact with those Illusions?
The core should be, that the GM does not use his meta knowledge.
That means if those illusions are cast out of the enemies sight the enemies would interact with it as if the illusion is real.
You could use an illusory wall as full cover and peek around to attack your enemies, but as soon as you attack through the wall, the enemies will know that something is up. (physical interaction)
An exceptional case would be "what happens if you have three-quarters cover behind an illusion?" the core principle would be, that the enemy would try to avoid your cover and thus you could benefit from the cover bonus, but what happens if he misses? Does he hit your cover and reveal it as an illusion? That is up to your DM to decide.
(I personally would say, if the attack would hit if there were no cover bonus, the target hits the illusion and reveals it as such, but one can argue that the attack should have hit you then, too.)
If you happen to cast the spell while your enemies can see it there should be a few differentiations:
- an enemy who is stupid (beasts, low-int creatures)
- an enemy who is intelligent, but has little to no experience with magic (maybe bandits, barbarian tribes, more intelligent beasts)
- enemies who are intelligent and are either able to cast those spells themselves or at least know they exist
The first group should interact with an illusion as if it is true and avoid it.
The second group may use their action to determine if it is an illusion and tell their comrades of their results and then react accordingly.
The third group would know that this is probably an illusion and ignore it. Attack your spot based on position or just by listening (attack unseen target). The only reason for them to look closer to the illusion would be if they need to see their target for their spells. And as soon as the first enemy shoots through the illusion it would reveal itself.