Primary or Secondary
For the historian, there are two principal kinds of materials: Primary sources (or Documentation) and Secondary sources (or Analysis).
Documentation (Primary sources):
In a court of law there are two basic kinds of witnesses: eye-witnesses (people present at or directly involved with the crime) and expert witnesses (people not involved in the crime, but knowledgeable about weapons, psychology, etc.). There are also character witnesses that tell the judge and jury something about the reliability of the witnesses in the case. The historian judges the testimony and tries to decide what probably happened.
For the historian, these testimonies are primary sources. The writers either experienced the events themselves or have talked to those who did. Expert witnesses may not have lived through the events of the specific case, but they can give essential information about relevant situations, procedures, materials and so on.
Analysis (Secondary scholarship)
Secondary works are written by historians. As a student of history, your job is to look at what historians and others have written and decide whether their verdict was fair.
Understanding the context of the subject is important to understanding what happened. Your textbook, a standard history, or an encyclopedia will help you with background. Consensus scholarship is “what is established beyond contesting.” Background materials like encyclopedia articles are to help your understanding of the historical events: they are not materials to base your research papers on.
Evaluating primary sources
The situation is really more complicated than this. Check out this page from the American Library Association. Although this introduction to using primary sources concentrates on web-based resources, it contains a useful discussion of the different kinds of primary sources in all media.