The physics of tokenization