Demons and evil spirits fear sunlight, flames, and noise for one basic reason: all three act as "strong sources of interference".
It's like dropping a drop of ink into a cup of clear water—the ink colors the water.
But there are also special exceptions, or standards by which to distinguish demons and evil spirits from other mysterious forces.
The first situation is called inherent cognition, that is, a concept that has already formed in the collective subconscious of the masses, such as the Dragon King being in charge of bringing clouds and rain, or a Taoist writing talismans to subdue demons and eliminate evil.
The second situation is called official recognition. Although Wang Yunxiao still doesn't understand the principle behind it, as long as one chooses any of the twelve Cultivation Dharma Gates officially recognized, whether from the Righteous or Heretical Path, they won't be affected by other "strong sources of interference".