Writing is communication, and the first and foremost function of a text is therefore to convey some kind of message to its reader. In academic writing, the purpose of the text is usually to convey information to other people within the field. This information can take various forms: new data, suggestions for a new approach, a new interpretation, etc. Writers therefore need to take their intended readers' knowledge of the subject into consideration.
For reasons of integrity (such as the importance of avoiding bias), as well as for reasons of clarity, writers need to be aware of their audience. This is something that is often discussed in essay courses, and students who feel uncertain about how to tackle the question of potential readers are advised to raise the issue with their supervisor.
In undergraduate writing (short essays, take-home exams, response papers, etc.), the intended reader is usually the teacher and peers of the student. In degree projects and theses, the audience is more extended and also more varied. A degree project in engineering or in law, written in cooperation with a company or an organisation, for instance, may have a more clearly defined readership than a degree essay within, say, history or comparative literature.