Graphical Representation of an Assembler-Source: logrocket
The above image shows how an assembly level language is transformed into machine code when it is compiled. This is what exactly happens when WebAssembly code runs in browser. But since WebAssembly is in binary format, it becomes much easier for the compiler to convert it into machine code.
Functioning of a WASM: Source: logrocket