At the beginning of The Adventures of Huckleberry Finn, Huck, now rich, is living with the Widow Douglas when his father comes to reclaim him by force. At first, Huck is relieved to be freed from the straightjacket of civilization, but it quickly becomes apparent to him that life with a violent alcoholic is not ideal, either. He decides to run away from Pap, faking his own death so that he will not be pursued.
Huck shoots the pig in order to use its blood to lend verisimilitude to the scene he arranges for Pap to find when he returns to the cabin. He leaves the dead pig to bleed on the floor, then fills a sack with stones and drags it through the blood to the river, where he throws it in the water. This is to give the impression that his dead body has been dumped in the river by thieves who have robbed the cabin, leaving a scene of devastation behind.
It is characteristic of Twain's narrative that this scene, which would presumably be disgusting and frightening in real life, is described with a sense of zest and adventure. Huck even wishes that his imaginative friend Tom Sawyer could be there to help him with the artistic details.