A tokenizer is a fixed, deterministic mapping in both directions. Going forward, it segments the input text into subword pieces and replaces each piece with its integer ID from the vocabulary, producing a token ID sequence. Going backward, it looks up each ID and concatenates the pieces to reconstruct the text.
The vocabulary is the bridge between the two directions: an ordered list of every token the model knows, where the position in the list is the integer ID. Because the mapping is fixed, the same text always produces the same IDs, and the model's parameters never have to deal with raw characters.
One practical consequence is that the reconstruction is not always character-identical. Whitespace is often attached to the following token, and a piece like "ization" carries no leading space, so joining pieces back together requires knowing the tokenizer's spacing convention. The IDs are what the model consumes; the text is only what we read.