CodeSandbox is a service similar to CodePen (or StackBlitz which also uses nodejs emulation in the browser).
The benefit is that you can use a web editor with the same dev tools (TypeScript, Babel, vite, webpack, etc) without a server VM. That saves them a lot of money in cloud instances, and speeds up things for the end user.
Other than that a posible niche use case is to emulate a full-stack for prototyping or testing purposes.