Good observation,
A JWT consists of three parts,
the header, payload, and signature.
The header and payload are Base64URL-encoded, and the three parts are concatenated in that order using periods (.) as separators.
A common JWT header is:
{"typ":"JWT","alg":"HS256"}
Because this header is often serialized exactly the same way, it's Base64URL-encoded representation is also always the same.