emscripten
Unity uses the emscripten compiler toolchain to cross-compile the Unity runtime code (written in C and C++) into WebAssembly (also known as Wasm). It is designed to be small in size, load-time and memory efficient as well as able to deliver close to native speed execution. For more information about WebAssembly in Unity, check this blog post.
To convert the .NET game code (your C# scripts) into WebAssembly, we use a technology called IL2CPP. IL2CPP takes .NET bytecode and converts it to corresponding C++ source files, which is then compiled using emscripten to convert your scripts to Wasm.
Emscripten は LLVM を利用した wasm 出力のためのツールチェーンで、標準 C ライブラリのみならず、OpenGL や pthreads などの変換も対応してくれているので、既存プロジェクトの wasm への出力に関してはものすごく強力なツールです。