This is a toy tokenizer: a few hundred pieces and greedy longest-match. Real ones learn about 100k pieces from data, but they behave the same way, and they never output an unknown token, because raw bytes are the last resort.
How the pieces turn into a meaning, tied back to the layers