An embedding gives each word one fixed position, and that is not enough, because words change meaning with the words around them. “Bank” on its own could be a river bank or a high street bank. Attention is the step where every word in a sentence looks at every other word and adjusts its own meaning to fit. Next to “river”, the position of “bank” shifts towards nature. Next to “loan”, it shifts towards money.
The same step is how a model works out what “it” refers to. In “the animal didn’t cross the road because it was tired”, attention connects “it” to “animal” rather than “road”, because tiredness goes with animals. Nobody wrote that rule down. The model learnt in training which words tend to belong together, and attention applies that at the moment of reading.
Attention runs many times over, in layers, and each pass refines the meaning a little more. It is also the reason a model can take a whole paragraph into account at once instead of reading one word at a time and half forgetting the start. That design, attention repeated over a whole passage, is the Transformer, the subject of the last entry in this series.