What does Mark 5:12 mean?
Jesus is expelling a legion of demons from an afflicted man, but before the demons leave, they would like clarification as to where they should go. They beg Jesus not to send them to the Abyss—to the bottomless pit of torment for demons with particularly grievous sins—before their time (Matthew 8:29; Luke 8:31). So, they present a counter-offer of entering into a herd of pigs on a nearby mountainside.The act of demons leaving a human and entering a pig had cultural precedence. In the Babylonian rite of exorcism, the demon was supposed to be transferred to a lamb, a pig, or a bird which was then destroyed in an attempt to keep the gods' attention on the demon and off the victim.
Neither is this the first occurrence of an evil force working in concert with an animal. We still don't know the exact relationship between Satan and the serpent in the garden of Eden, whether Satan took the form of the serpent or used a snake as a ventriloquist's dummy, but Mark 5:13 shows that it's very possible Satan actually possessed the animal.
The question as to why the demons considered moving on to the pigs a good idea has never been answered. It may be that their long-running destructive force needed a powerful outlet before they could move on to different things.