I am no expert but my limited understanding is that there are two components - a detergent and an emulsifier:
Grease - being organic fat and oil based - is water-repellent, so the polar configuration of water can't tear it apart (which is what it usually does to most things). Fats and oils are some of the few things that are immune to water's "nigh-universal solvent" property.
But the detergent molecule has a shape with two different ends - one end has an affinity for oils and attaches itself to the grease, the other end has an affinity for water and allows water to attach to it.
The grease now literally has a handle that the water can grab and pull. The blob of grease is torn into smaller micro droplets, which are further surrounded by the oil-loving detergent molecules. The micro droplets are prevented from coalescing back into a large blob of grease while at the same time the water is free to transport the droplets away.
Using hot water gives the water molecules more "kick", making them more efficient at ripping apart the fats and oil molecules.