Attention is a soft lookup. A query asks a question, every key is scored by how well it lines up with the query (a dot product), and softmax turns the scores into weights that add to 1. The answer is a weighted average of the values, so a key that matches well gets most of the say, and a temperature decides how winner-take-all that is.