Token IDs are arbitrary integers. The number 47458 means whatever the BPE merge that produced it happened to mean — there is no semantic structure in the integer itself. The model's job, before any attention happens, is to turn each ID into a dense vector that does have semantic structure.
This is a learned lookup. The embedding matrix has shape (vocab_size × d_model). Indexing it by token ID returns a row of size d_model — that row is the token's initial representation. During training, gradients flow back to those rows, nudging them so that tokens used in similar contexts end up with similar vectors.
The result is a high-dimensional space where geometry encodes meaning. "Cat" and "dog" end up close. "King" and "queen" end up close. "Run" and "running" end up close. This is the substrate that all subsequent layers refine — they don't operate on words, they operate on points in this space.