IANAP but from my limited understanding (mostly reading Richard Feynman)
light beam = stream of photons, they don't travel through entire body of glass prism without issue, they get absorbed and re emmitted along the way too (Which is what explains the different speed of light in different mediums)
I'm not convinced but even if we accept that explanation, why do all the atoms along the way emit the light in the direction it was travelling and then the ones at the surface suddenly emit it in a different direction?
I can recommend Hecht’s Optics textbook for this. I found it at my local library. I have had a number of electromagnetics courses over my life and none explained the unifying scattering principles of reflection, transmission, and refraction concept so clearly as that book
They don't! That's why the thickness of th glass of affects it's reflectivity, and not the simple way you might guess. Read Feynman's QED book or watch the YouTube vidoes for a lay intro.
Probably it's just how the math works out. The atoms emit in all directions, however the waves traveling in all the other non-correct (according to reflections and refraction laws) directions cancel each other out, and only the ones with the new correct direction are still there / visible.