1846 in the schoolboy sense, "bit of paper chewed and rounded as a missile;" 1904 in the baseball sense, from spit (n.1) + ball (n.1).
Entries linking to spitball
spit n.1
"saliva," early 14c., from spit (v.1). Meaning "the very likeness" in modern use is attested from 1825 (as in spitting image, attested from 1887); compare French craché in same sense. Spit-curl (1831) was originally considered colloquial or vulgar. Military phrase spit and polish first recorded 1895.
ball n.1
"round object, compact spherical body," also "a ball used in a game," c. 1200, probably from an unrecorded Old English *beal, *beall (evidenced by the diminutive bealluc "testicle"), or from cognate Old Norse bollr "ball," from Proto-Germanic *balluz (source also of Dutch bal, Flemish bal, Old High German ballo, German Ball), from PIE root *bhel- (2) "to blow, swell."
The meaning "testicle" is from early 14c. (compare ballocks). Ball of the foot is from mid-14c. The meaning "rounded missile used in warfare" is from late 14c.
The meaning "a game played with a ball" is from mid-14c. The baseball sense of "pitch that does not cross the plate within the strike zone" is by 1889, probably short for high ball, low ball, etc.
Ball-point pen is by 1946. Ball of fire when first recorded in 1821 referred to "a glass of brandy;" as "spectacularly successful striver" it is attested from c. 1900. Many phrases are from sports: To have the ball "hold the advantage" is from c. 1400. To be on the ball is from 1912; to keep (one's) eye on the ball in the figurative sense is by 1907, probably ultimately on golf, where it was oft-repeated advice. Figurative use of ball in (someone's) court is by 1956, from tennis.
The head must necessarily be steady, for it is most important that you should keep your eye fixedly on the ball from the moment that the club-head is lifted from the ground until the ball is actually struck. "Keep your eye on the ball," should be your companion text to "Slow back." [Horace G. Hutchinson, "Hints on the Game of Golf," 1886]
Once a meeting is over, someone will be expected to do something. Make sure it is someone else. This is known as keeping the ball in their court. [Shepherd Mead, "How to Get Rich in TV Without Really Trying," 1956]