I was wondering how does a WebSocket work or how is it made?
You can find a quick answer to most of the questions in this link
https://askinglot.com/what-is-laravel-echo-server
we use Pusher as a WebSocket service right?
You can use this service, it's the main one, https://ably.com is an other one but you can also use you own websocket server with laravel-websocket that uses the same protocol as pusher.
how pusher is created?
Have a look to its "clone" https://github.com/beyondcode/laravel-websockets