The Bosses forced Fred, while in Peter's body, to take an army of Poltergeists to Purgatory and destroy the Ghostbusters. Since the living could not go, the Bosses made a deal with a demon. In exchange, the demon could have Peter to torture, dismember, and disembowel for all eternity. The demon provided oxygen for Peter's body to survive indefinitely. The rules were bent but the Bosses' army failed. The demon arrived to collect Peter and return Purgatory back to its neutrality in celestial politics.
However, the demon was unaware Peter was possessed by a ghost at the time. The demon resolved this and moved to simply eat everyone. Peter, now back in his body, overloaded his Proton Pack in order to confine it while Winston Zeddemore trapped it. At Egon Spengler's behest, they likely transferred the demon into the Containment Unit once they returned to the physical plane.
The demon is much stronger and higher in stature than the Winged Demon and Demon Border Guard. One power the demon displayed was bestowing oxygen to the living while in Purgatory. It could resist a standard Proton Stream but could be trapped.