A context window is the maximum amount of text, measured in tokens, that a model can consider in a single request. It holds the system instructions, the conversation so far, any documents you paste in, and the answer being generated. When the total exceeds the limit, something has to be dropped or summarised.
Retrieval-augmented generation is a pattern where the system searches your own documents for passages relevant to a question, puts those passages into the model's prompt, and asks the model to answer using them. The model's weights never change; the knowledge arrives as context at request time.