ultrasonic (high frequency) sound waves cause bubbles to quickly form and collapse in a liquid, over and over. The sound actually pulls the liquid apart and creates bubbles that are empty..a vacuum.
The bubbles have a lot of energy when they "pop". This dislodges dirt. And the bubbles are microscopic and get into every nook and cranny.
I forget the exact number but, if translated into temperature, the energy of the tiny individual bubble reaction is like thousands of degrees. (this is why the cleaning fluid gets warm)
Something very similar happens when a boat propeller is spinning too fast and "cavitates" .. the metal surface of the propeller ends up looking like it was sandblasted.