The server is switching protocols as requested by the client, typically upgrading from HTTP/1.1 to WebSocket.
101 Switching Protocols is the response that establishes a WebSocket connection. The client sends a normal HTTP/1.1 GET request with Upgrade: websocket and Connection: Upgrade headers; the server responds with 101 and the connection then becomes a WebSocket carrying its own framed protocol. You also see 101 used for HTTP/2 upgrades over cleartext (h2c), though most modern HTTP/2 uses TLS ALPN instead.
When servers should return it: Servers return 101 when they accept an Upgrade request and switch the connection to a different protocol. After 101, the connection is no longer HTTP.
curl --include --no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==" \
--header "Sec-WebSocket-Version: 13" \
https://example.com/ws
For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.