There are two major differences between fiction and nonfiction. First, nonfiction writers must stick to things that really happened; writers of fiction can make up anything they wish. Second, fiction depends on a plot; nonfiction writers are much freer to bounce around in space and time to make their points.
So your answer is Nonfiction is considered a type of literature because it bases its overall plot on actual historical events.