Soap is interesting, it was made back in the day from fat and alkali usually from wood fire ash. The fat is saponified, something that rips off the glycerol attached to it leaving a charged end (COO-). One end remains fatty, olephilic, and the other is charged. In water, it forms micelles, with the charged ends pointing out and the fatty parts pointing in. Any fatty stuff in the water tends to get trapped inside the micelles.
Detergents do the same thing but are made synthetically (from oil etc.). So, soap rips apart the lipid (fatty) component of a virus and the rest falls apart.