A documentary is a film or video examining an event or person based on facts. The word can also refer to anything involving documents.
The idea of documentary as meaning "pertaining to documents" came about at the beginning of the 19th century. Later, it came to mean a factual record of something. On PBS, you'll see lots of documentaries, about everything from baseball to war. Those documentaries are nonfiction films — they're showing true life. However, lots of fictional shows are filmed in a realistic documentary style. If you make a documentary about the U.S. Library of Congress, you'll be documenting lots of historical documents.