The primary use of Websockets in computer science is to facilitate real-time, bidirectional communication between a client (like a web browser) and a server, thereby improving interactivity and performance.