Sparring is the act of simulated fighting for the purpose of practicing and improving one's skills under some form of resistance from the partner. The spectrum of intensity can range from light sparring to full-contact. Goals for each individual can also vary widely from practice of a specific technique, drill, or concept, to general purpose sparring that aims to hone overall skills.
The purpose of sparring is to put the techniques learned into practice against a resisting opponent. Part of this is for pressure testing, which is testing techniques under realistic conditions to see if they actually work. It is not enough to simply learn the techniques or to practice strikes on training equipment like a heavy bag. Learning the technique in a safe environment is important, but it's only the beginning. Sparring allows students the opportunity to learn how and when to effectively apply the techniques against opponents of varying degrees of skill.
To limit the likelihood of injury, varying degrees of protective equipment is worn.