Tom Sawyer is often tempted to throw inanimate objects at his goody-two-shoes cousin. On this particular occasion, though, he throws some clods of earth at him. This is Tom's revenge on Sid for ratting him out to Aunt Polly for playing hooky and going swimming. When Tom went for a swim, he had to remove the thread from his shirt collar. Before retuning home, he sewed the collar back on his shirt so that Aunt Polly wouldn't suspect that he'd skipped school to go swimming.
But at dinner that evening, the eagle-eyed Sid notices that Tom's shirt collar is being held together with black thread, even though Aunt Polly had sewn it with white thread. Thanks to sneaky Sid, Aunt Polly now realizes that Tom played hooky to go swimming. She punishes him by making him whitewash the fence on Saturday, when all the other kids are out enjoying themselves. It's after he's finished whitewashing the fence—or rather, after the other kids have finished whitewashing it for him—that Tom throws clods of earth at Sid for snitching on him earlier.