Just as God bound up many evil spirits in the middle of the Old Testament age (Noah’s Rainbow Covenant), Revelations describes how he will destroy a huge swathe of evil spirits in the middle of the New Testament age. To understand what this means, we need a bit of the history.
When Adam and Eve sinned, they handed authority over the earth to the spiritual forces of evil. This was a huge disaster, because it left God powerless on earth. He still had authority in the spiritual world, but his authority on earth was gone. This was painful for him, as he was committed to sustaining the earth every day, but had lost authority to get involved in the world that he loved.
Once God was squeezed out of his universe, the powers of evil got to work and really messed it up. For nearly a thousand years, God was shut out of his creation, so he could not hold back the forces of evil. The Holy Spirit was entirely shut out of the earth, so evil advanced in a terrible way. All human developments were twisted for evil purposes.
The LORD saw how great the wickedness of the human race had become on the earth, and that every inclination of the thoughts of the human heart was only evil all the time (Gen 6:5).
The first sign of spiritual life on earth was Enoch, the first human prophet since Abel (Luke 11:51, Jude 1:14). He began a line of prophets that released the ministry of Noah (Gen 5:29). Noah’s prayers gave God authority to send the flood that would sweep away the evil that had spread through the earth.
At the time of the flood, some of the spiritual powers of evil tried to smash up the “depths of the earth”, but this got them into trouble. God had given authority over the earth to humans, but they did not have authority over the depths of the earth, as God retained control of the planet for himself. When Adam rejected God, the spiritual powers of evil gained authority over the earth. Provided they remained in contact with the earth, God could not touch them.
During time of the flood, some of the spiritual powers attacked the depths of the earth and broke them up.
On that day all the fountains of the great deep were broken up (Gen 7:11).
By striking the great depths of the earth, they moved away from the place where they had authority. This left them vulnerable to attack. God was able to send a host of angels and take them captive in the Abyss and prevent them from working on earth any more. He had authority to do this, because they had moved to a place where they did not have authority.
A proportion of the spiritual powers of evil were locked up so they could no longer work on earth (2 Pet 4-5). Peter explained that,
Jesus went and preached to the spirits in prison, who were disobedient long ago when God waited patiently in the days of Noah (1 Pet 3:19-20).
The number of evil spirits working on earth was substantially reduced, but there were still plenty of others with freedom to work on earth. They continued to do evil and oppress the people of the earth.
The legion of evil spirits that controlled the Gadarene man knew about the abyss and understood that spirits were trapped there.
They begged Him that He would not command them to go out into the abyss (Luke 8:31).
They did not want to be trapped in powerlessness. Jesus sent them into the pigs, which ran into the sea. The pigs were drowned, because evil spirits love death. I presume that Jesus could have sent them to the abyss, but chose not to, so people would get a revelation of the power of evil.