So the query is the function, the keys are the arguments to the function and the values are the result of applying the function to the arguments. Here the result of the function is memorized from the training set and not computed.
The argument that "chatbots can't create anything new" is completely bogus (and is often tied up in a fetishization of creativity), there is no fundamental reason one can't attempt a literary task like "Write a play in the style of Shakespeare set in Russia's October Revolution". On the other hand it can't (correctly) make up factual information that it hasn't been trained on: ChatGPT on it's own resources can't talk about who won the Superbowl or Premier League this year because it hasn't seen any documents about it.
Note it doesn't have to be words, the same strategy works amazing well for images and audio, see
Caveat: I'm not super on top of AI stuff, but that description struck a chord with me.