The Sacred Scriptures teach that there good angels and bad angels. The bifurcation of angels into good angels (like Saint Michael) and bad angels (like Satan) is discussed by Saint Thomas at Summa theologiae I, qq. 63-64. Let’s take a look.
Following passages from the Old and New Testament, Saint Thomas teaches that the angels were tested. Some angels adhered to God and were rewarded with the beatific vision of God’s essence (good angels) and some rebelled and lost grace (bad angels or demons). According to Christian tradition, Satan was once a seraph and the highest angel of all.
A defect appeared in the bad angels. Thomas cites Job 4:18: “In His angels, He found wickedness.” When they were first created, the angels did not have the beatific vision of God’s essence. They were literally blind to vision of God. They were first tested (some say by a vision of Christ incarnate in Mary, see Revelation chapter 12) and certain angels could not accept serving God if it entailed serving a lower species—namely the human species. One third of the angels fell and became demons.
Maria de Agreda relates that when Lucifer learned that the Logos would become man through a human mother; Lucifer, the highest of all creatures, demanded the honor of becoming the Theotokos. He wanted the hypostatic union to occur through him. This is another reason why there is perfect enmity between Satan and Mary (see Gen 3:15). It is also why Mary now has the highest place in Heaven.
Thomas quotes Saint Augustine who says that the devil “is not a fornicator nor a drunkard nor anything of the like sort, yet he is proud and envious.” (City of God, 14, 3)
Lucifer and one third of the angels fell on account of pride and envy. Thomas explains that the devil wanted to be God and he cites Isaiah 14:13-14: “I will ascend into Heaven…I will be like the Most High.” Saint Augustine also confirms that Satan “wished to be called God.” (see his Concerning the Old Testament, 113) Michael, a lower angel, led the charge against Lucifer and his fallen angels by calling out: “Mi Cha El?” which is Hebrew for “Who is like God?”
Saint Augustine relates the fall of the evil angels to the book of Genesis: “And God saw the light that it was good, and he divided the light from the darkness” (Genesis 1:4, D-R). Thomas picks up this allegory from Augustine, and identifies the separation here as the division of the good angels from the bad angels who became “dark.”