A large language model has one job. Given everything written so far, it works out the most likely next word and adds it. Then it does the same again, one piece at a time, until the reply is finished. There is no reasoning step and no database being searched. The fluent paragraph you read is the result of thousands of those guesses in a row.
Each guess is a set of odds, not a lookup. After “the cat sat on the”, the model might give “mat” an eighty per cent chance and “rug” nine per cent. It picks one, usually but not always the favourite, and runs the whole calculation again with the new word included. That is why the same question can get a slightly different answer each time, and why a reply can be confident and wrong at the same time. The model is choosing what sounds likely, and what sounds likely is often true but not always.
What comes next?
The cat sat on the ?
The useful way to hold this is as a very capable autocomplete. It has read an enormous amount of text, so its guesses are good, and the longer the run of good guesses the more it reads like thought. Keep that picture in mind and the rest of AI gets easier to follow. Tokens are the pieces it guesses in. Embeddings are how it knows what the pieces mean. Attention is how it uses the words around each piece. Each has its own entry in this series.