Mark 5:12-13 recounts how Jesus allowed the 'legion' to enter a herd of pigs after hearing their pleas. Is this a case of Jesus showing compassion to demons? If not, what is Mark trying to communicate here?
Jesus is showing compassion to the man
The relationship between Jesus and demons is complicated as presented in Mark. On the one hand, Jesus has authority over them, and on the other, they still cause problems for him. Take his first encounter with a demon recorded in Mark 1:23-26 (ESV):
Jesus answers the charge that his powers are from Beelzebul in Mark 3:23-27 (ESV):
I won't give a complete survey of demons and unclean spirits in the Gospels, but if you do the exercise, you'll see that:
Since there were herds of pigs, the region mentioned in Mark 5 ("the country of the Gerasenes") must have been Gentile. Demons operated best in Gentile regions (extrapolated from point 1. above), so what the demons asked was to not be cast out of the happy-hunting ground of that country. They would have preferred to stay in the man, but they knew he would cast them out (from 2).
Mark emphasizes that the man came to Jesus and not the other way around ("when Jesus had stepped out of the boat, immediately there met him out of the tombs a man with an unclean spirit" and "And when he saw Jesus from afar, he ran and fell down before him."). Once there, however, the demons seem to take control of the interaction. They know what is about to happen to them (point 4) and take the opportunity (point 3) to attempt a negotiation. But the negotiation is a bit like the negotiation between the police and a man being evicted—he might ask to be able to walk out of the house rather than being dragged out. No matter what, the demons are not getting what they would really like to have: free reign over the man.
But what about the effect on the man? It seems there were two options for how the exorcism could go down:
Remember that the man was insanely violent and scary (Mark 5:3-4 ESV):
Afterward, the people didn't know what to make of him (Mark 5:15 ESV):
Jesus hadn't been operating in that country and it doesn't seem like the people knew who he was or what he was capable of. So I read their fear as arising from not knowing what happened to the powerful demons. Like going into a haunted house and everything suddenly gets quiet, the fear actually increases in that situation. But the people soon learned what had happened to the demons (Mark 5:16-17 ESV):
Now it seems that the man was able to live a more normal life after that. At least part of the reason might be that everyone knew his demons were destroyed. There was a considerable economic cost, but the blame for that seems to have rested solely on Jesus. When Jesus summarized the incident, he emphasized the Lord's mercy toward the man (Mark 5:19 ESV):
A passage in Luke 11:24-26 (ESV) seems to be related to this incident:
Perhaps the demons were trying to avoid passing through "waterless places".
I don't see this as compassion, but as allowing them to choose their punishment.
Jesus had a couple of different options on how to deal with the demons. Indeed, he probably had more options than we know of. However, we know of two, for sure.
The first option, send them out of the country:
The second option for punishment, sending them into a group of swine:
Jesus allowed them to go into the swine.
I can see how this might be confused with compassion. However, Legion had earned a punishment and Jesus was going to be the source of that punishment. I see Jesus simply allowing them to choose their punishment. I don't really see that as compassionate, as much as simply permissive.
Matthew comments on Mark:
Matthew uses parallel passages such as Jesus going up the hill in Ch 5 and coming down the hill in Ch 8 to force Drash methods on us. Mat 5:20ff is parallel to Mat 8:28.
The scribes and Pharisees are made to be like the demons. They both knew who Jesus was . They both did not wish to submit to him. They both preferred to kill something instead .
 Jesus taught the temple workers who he was when he was 12. He called them liars, not misguided teachers.
 The demons wanted to kill the swine, and the scribes and Pharisees wanted to kill Jesus. Both the swine and Jesus were abominable since Jesus had been made to be sin upon the cross.
Jesus actively participated in painting pictures of the cross in the things he did. So it is more likely that Jesus actively participated in the picture, Mark recorded the event literally, and Matthew put it in the context of sensus plenior.
I don't think it was compassion, I think it was an object lesson, or illustrated sermon being played out on the screen of their everyday life. (Thus when the familiar was ripped out from under them they were unnerved and terrified.) What was the lesson? Maybe it was all about AUTHORITY? Witnesses saw and heard that the demons could not choose their fate without Jesus' permission. "Injury"--cast them into the least holy of creatures-- the very symbols of what was clearly understood by all in that culture as unclean. "Insult to Injury"--now, in living color, the demonstration is complete. An excamation point is added to this show of the demons' powerlessness as these lowly beasts choose death!
MY QUESTION is, where then did the demons go next? In to the pit? OR, into the people of the town, which would explain Luke 8:37.
No. Jesus shows compassion on the man. At the instance of deliverance this man can see God's compassion as the demons enter the pigs and they enraged run off the cliff. The man had the chance to truly see the grace of God, to know his worth as a person. He was thus so impacted he didn't want Jesus to leave him!