The swirling effect observed when soap detergent is added to a dish of milk with food coloring is primarily due to the properties of surfactants. Soap detergent contains both hydrophobic and hydrophilic components, which interact with the milk and food coloring. The food coloring, likely a dye such as "Ponceau," becomes soluble in the detergent, leading to the movement and dispersion of color. Additionally, Brownian motion may contribute to the swirling effect, as the random movement of particles in the liquid enhances the mixing process.