The story
From the concept that a pitch thrown very close to a batter will remove some dust or dirt from the batter's uniform either by brushing against it or causing a breeze very close to it, or alternatively by the batter jumping away from the pitch to avoid being hit.
Etymology from Wiktionary, CC BY-SA 4.0.