The context window is the total amount of text the model can hold in mind at once.
It is measured in tokens and covers everything, not just your latest message.
The system prompt, the conversation so far, retrieved documents and the reply all share it.
Once it is full something has to be dropped, summarised or refused.
Windows have grown from about 2,000 tokens to hundreds of thousands.
That growth changed what is possible, since a whole codebase can now be pasted in.
The cost of attention grows with the square of the length.
Doubling the input roughly quadruples the attention work.
So a long window is expensive in money and in latency, not just in capacity.
Filling it also degrades quality, because material in the middle is attended to least reliably.
A model with a 200,000-token window does not use all of it equally well.
Benchmarks that hide a fact in a long document expose this clearly.
The practical advice is to send what is relevant rather than everything you have.
That is the argument for retrieval surviving despite ever longer windows.
Nothing outside the window exists for the model, which is why chat history is resent every turn.