This server is just a piece of software that accepts and responds to TCP sockets. It could be anything, but you’re not consuming more CPU power by doing less work.
The http protocol requires you prepend every message with a bunch of headers and for them to have a static size. (tho plenty of apps allow you to bend the rules quite a bit)
After switching to a websocket, none of that applies. You can just dump data straight into the TCP socket. Or TLS stream that goes into the TCP socket. But that would be same for the http requests
Adding headers and some other minor requirements is slower than not. That’s really the difference, it’s not complicated.