Aesthetically, it provides a visual buffer between the frame, which can sometimes be very elaborate, and your image. This will keep them from competing for your attention. It’s presence will also serve to enhance and, if necessary, dress up what you have chosen to preserve.
Matting does a great deal to protect your artwork from a number of factors that would degrade and discolor. Without it, UV light, pressure and humidity built up underneath the glass can serve to transfer the paint and/or pigment of the art onto the glass. At worst, the artwork adheres to the glass, and it’s removal almost invariably will result in some level of tearing.
Most wood frame mouldings carry varying degrees of natural acidity and chemicals as well. A distance of at least 3 inches is generally agreed amongst art conservators to be sufficient to keep prints and paintings from yellowing from direct contact with frames; an elegant mat hides this distance while maintaining the eye-pleasing presentation you’re striving for.