The Prince of this world has been cast out
Christs miracles were ordained to manifest his divinity. However, this had to remain hidden from the demons, otherwise the mystery of the passion would have been hindered by them: If they had known the Lord of glory, they would not have crucified him, (1Cor 2:8). It would seem, then, that Christ should not work miracles over the demons
Yet the prophet Zechariah predicted these wonders when he cried out: I will take away the spirit of uncleanness, (Zec 13:2). Indeed, Christs miracles were proofs demonstrating the faith he taught. Now, through the power of his divinity, was it not fitting for him to do away with the demons power in those who would believe in him, according to Saint Johns words: Now the ruler of this world is driven out? (Jn 12:31).
Thus it was fitting that, among his other miracles, Christ should deliver from demons those men who were possessed by them
Besides, Saint Augustine writes: Christ made himself known to the demons for as long as he wished to do so, and he wished to do so for as long as it was necessary
through certain material consequences of his power. At the sight of his miracles the devil came to believe through conjecture that Christ was the Son of God: the demons
knew he was the Christ says Saint Luke (Lk 4:41). If they confessed he was Son of God, it was by way of conjecture rather than by way of knowledge, Saint Bede comments. As for the miracles Christ accomplished when he cast out demons, he did not do these for their own usefulness but for that of men, so that they might give glory to God. That is why he prevented the demons from speaking about anything affecting his praise. Saint John Chrysostom observes: It was not fitting that the demons should take to themselves the glory proper to the function of the apostles, nor that lying tongues should preach the mystery of Christ.
Pope Blessed Pius IX