Each soap molecule has 2 ends with opposite cravings: one clings to water, the other to oil.
In the wash, the oil-loving ends burrow into a grease droplet while the water-loving ends face out, sealing it into a micelle. Scrubbing breaks the smear into droplets too well-wrapped to stick back down.
Nothing dissolves: the grease leaves as sealed parcels because the rinse carries them down the drain.