Such a ball presents an unfair challenge to the hitter, since it may slide on the bat and is very hard to hit true if the bat comes in contact with the contaminated part of the ball.
Alternative names for the spitball are mud ball, shine ball and emery ball.
The spitball was perfectly legal until 1920. When the prohibition was introduced, it was recognised that there were some professional players who had built their careers on the spitball. A special exception was made for these few named players and they were permitted to throw spitballs for the rest of their careers.
The spitball is still sometimes illegally thrown. Typically, vaseline is hidden behind the pitcher's knee or under the peak of his cap.