On the first request, the server creates a session_id, stores the session data, and sends the session_id in a cookie. Every subsequent request contains that cookie — the server finds the data and "recognises" the user.
A session is server-side state; JWT is client-side state (in the token). A session can be invalidated instantly; a JWT can only expire naturally or via a blacklist. Sessions suit traditional web apps; JWT suits stateless APIs and microservices.