From Mark Chapter 1, did these demons recognize who Jesus was?
Demons are not omniscient, they are not all knowing as God is. The demons are hearing about this Messiah, a name they are familiar with. And they are familiar with a “Messiah” because they were created by God. Once Lucifer sinned, 1/3 angels who also sinned were banned back down to earth. They knew the end was going to be death for them, in the Lake of Fire. You can learn more in our study of Ezekiel 34 taught by Pastor Steve.
Once they saw and heard what Jesus was doing and, in a sense, “put face to a name”, they thought “Oh snap, judgment is near, we gotta go”. This is they reason why they have this exchange “What business do we have with each other?” Is it that soon? Is it time (for judgment)?”
The reality is the first coming of Christ was not to come bring judgment. The second coming is when the gavel hits the plank and its done (the demons are then sent to the Lake of Fire).