Difference between http and express

I’m trying to build a socket.io based application and I can’t seem to get the difference between http and express.

import express from 'express';
import http from 'http';
import {Server} from 'socket.io';

const app=express();
const server = http.createServer(app); 
const io=new Server(server,{
    cors:{
        origin:"http://localhost:3001"
    }
});

Why do I need http when it has the same functionality as express?
Could anyone explain this code?