Can anyone summarize how this works. Guessing Audacity is some C++ program. How did they take all the dependencies and make them work on browser, using WASM? What about the frontend? Is the UI just completely re-written?

I think so. They use Emscripten to compile.

https://github.com/ahilss/wavacity

Remarkable.