As is the case for most biblical narratives, in order to get a better understanding of one narrative it helps to read the surrounding narratives, and understand some history of the time and place. All three accounts of this story are preceded by the story of Jesus crossing the Sea of Galilee with his disciples when a “storm” erupts during the night.
Jesus then shows his mastery over the sea by calming it so that he can carry on his mission the following day, and to show his disciples the folly of pagan sacrifices to the sea. There is an important Greek parallel to this story. Remember that he is going into a Hellenized (Greek influences) territory, and his Jewish disciples aren’t really excited about it, in fact they are probably a little scared, just as they were when they were crossing the sea in a “storm”. The parallel is in the Greek’s sacrificing to pagan gods, like Poseidon and Zeus, before a war, such as when Mithridates VI of Pontus sacrificed “to Poseidon by plunging a chariot with white horses into the sea” before the third war against Rome around 75 BC. But Jesus shows he needs no sacrifice to placate the sea because he is master of it.
The Decopolis cities would have been sacrificing pigs to pagan gods. Since these cities were Hellenistic, they may have sacrificed pigs to Greek gods such as Poseidon. Some sources suggest that these sacrifices were taken advantage of by demons, so that in fact, the sacrifices to pagan gods were, in reality, sacrifices to demons.
With that in mind, there then is the request from the demons that Jesus not send them into the Abyss. Interestingly, the abyss also means the “watery depths” which would have included the depths of the Sea of Galilee which was subdued by Jesus the previous night. But Jesus never tells the demons he isn’t going to send them to the abyss. The demons instead ask to be first sent into the swine before their trip to the abyss. Why would they ask that? And why would Jesus grant it?
IMO, they probably ask so they can fulfill the ultimate purpose of many of the swine, which is that of being a sacrifice to them, the demons. And, of course, to cause as much death and destruction as they can while manifesting their power as they plunge the herd into the sea.
IMO, Jesus allows this because he knows it will backfire on the demons and ultimately serve God’s purpose. Indeed it does, the mock sacrifice of the swine to the ‘Greek gods’ is completely lost on the Greeks and overshadowed by Jesus’ merciful act towards the possessed man. Of course, the demons didn’t see that coming, (Satan also didn’t see the sacrifice on the cross coming, Satan thought he had gotten the better of Jesus when he entered Judas) they have no eye for mercy. The saved man spreads the news of Jesus all throughout the Decopolis, with the help of the sensational, impressionable swine story. As a result, when Jesus returns some time later, there are thousands waiting to greet him.