why do a glass prism disperses light while a glass slab do not?
Dispersion of light occurs in prism because light rays deviate while coming out of a prism by an angle. This is called the angle of deviation. Now angle of deviation depends upon the refractive index of the medium of which the prism is composed. Now since different colors in the white light have got different refractive index. thus each color deviates by different angle from the other. Thus, these constituent colors separate out.
In case of glass slab , the two interface surface are parallel to each other , all the bending of light that take place at the 1st interface is exactly recovered at the 2nd interface , undoing the effects of the 1st interface.
That not happened in the case of prism because interfaces are not parallel.