early 14c. (as a surname), "one who smears salve on a sheep," agent noun from grease (v.). As a contemptuous American English slang for "native Mexican or Latin American," first attested 1848, a term from the Mexican-American War; supposedly so called from unclean appearance, but contemporary sources sometimes explain it otherwise: an 1848 account of the war defines it as "friendly Mexican," and adds:
It may here be necessary to explain, as the terms are frequently made use of, that mocho is a low Spanish word for a foot-soldier, and the term greaser we suppose is a corruption of word grazier, the class of péons or labourers of the country. [Samuel C. Ried Jr., "The Scouting Expeditions of McCulloch's Texas Rangers," Philadelphia, 1848]
Greaseball in same sense is from 1934 (earlier it was World War I slang for "an army cook," and from 1922 for "mechanic").