The signature ensures the token's integrity and authenticity.
In a JWT, the signature is used to verify that the token hasn't been altered and that it was issued by a legitimate source. For instance, in an API authentication scenario, the server can trust the token's claims if the signature is valid.