Because Minecraft’s render engine (LWJGL) is a wrapper around OpenGL, many devs use Emscripten to compile a C++ version of the game engine (like the TrueCraft or MineTest engine customized for 1.8.8) to WASM.
Security: WASM is sandboxed. A Minecraft 1.8.8 WASM client cannot touch your hard drive except through IndexedDB. It cannot execute system calls. It is arguably safer than the native Java client, which has historically suffered from Log4Shell vulnerabilities. minecraft 1.8 8 wasm
Legality: Microsoft/Mojang's EULA allows you to play the game on "alternative platforms" provided you own the original copy. Distributing the actual 1.8.8.jar file or the assets folder is copyright infringement. Legitimate WASM ports require you to upload your own local Minecraft files (the launcher will say "Play Offline"). Because Minecraft’s render engine (LWJGL) is a wrapper
Eaglercraft is the most famous implementation, though it started with 1.5.2. Community forks (like EaglercraftX 1.8.8) have successfully ported the combat update. It cannot execute system calls