That's not how stealth works. Oh, what a game of telephone. First, a DM wants his players to enjoy sneaking around. Then, a GM discovers sleuthing mechanics that make his role-playing game even more enjoyable and interactive. Later, a primitive video game employs shadow-based stealth. Later, the quality of the American education systems drops to such a degree that even basic geometry, the intersection of a line (a light ray) with a surface (the occluder producing the shadow) becomes to complicated to implement, so Stealth appears and is based on where you are relative to an NPC. Later, higher and higher stealth affects invisibility spells, such that, even if max invisibility can't hide you from a face-to-face confontation, "Stealth" can, a skill now meant to simulate the hush and quietude of a sniper in a ghilli suit (except you are in an invisibility spell suit). Much more time passes, and basic literacy falls from the curricula of the americanized world, and invisibility, reliant as it is upon graphical shaders now too complicated to implement, is done away with (as is levitation), giving way to STEALTH: a skill which brainwashes all the NPCs around you to magically forget where you were and all logic in the simple fact that even if you're not there, a phalanx need only continue advancing to stabby-stab you... AI decision-making logic which itself greatly exceeded the intellects of the world's greatest americanized programmers to implement.
Or, just compare early Thief and Splinter Cell games to their later iterations to witness the rise and fall of stealth gameplay.