A glass prism disperses light because its angled surfaces cause different frequencies of light to refract at varying angles, resulting in visible separation of colors. In contrast, a cuboidal glass slab has parallel surfaces that reverse the refraction, allowing light to exit without dispersion. This means that while light entering a prism emerges at different angles, light exiting a slab remains parallel. Spherical lenses also exhibit dispersion, leading to chromatic aberration, where different wavelengths focus at different points. The unique geometry of prisms is key to their ability to disperse light effectively.