Stray light is a problem that pops up in all sorts of optical systems. This is any light that goes where you don’t want it to.
This could cause glare in illumination systems, or it can degrade image quality in imaging systems. Stray laser light can cause some serious damage depending on how powerful the laser is! In automotive lighting, stray light can cause headlamps to fail government inspections. In sensor systems, sometimes stray light can come from something totally outside the optical system you design — like ambient light coming through a window.
Optical simulations can be used to figure out where offending stray light rays come from and bounce to. Simulations can also be used to figure out the best fix for stray light issues — trying out different solutions before anything is even prototyped.