Differences between WebSockets and Socket.IO

WebSockets and Socket.IO are probably two of the most popular solutions for implementing real-time communications in the modern web. But how do they differ?