I assume this is for an essay. This can be used in multiple situations. Let’s start with history. Say you are writing a DBQ (document based question), and you are using a source. For simplicity let’s say it was a document on George Washington. You would provide the context to that document. For instance George Washington was a great commander who led many people in the American revolution. He was the first US president however many wanted him to be king of the US. But per his own words he stated that the US should not have a king and follow a democracy. This the constitution. However when you are providing context, the context should follow the prompt in which you are writing. So if the prompt was about generals and who was the best, you would provide the context of the American revolution. But if it said context of “should the us have a monarchy or a dictatorship” you would provide the context of what he stated.
The same can be done for english, however it does require a little bit more thought to it. If you are writing about a book you need to provide the context or situation to the quote or evidence.