Well, the main difference is that 'nonfiction' is the correct and widely accepted term for works that deal with real-life subjects, events, or people. 'Non-fiction' could be seen as a misspelling or an informal variant. Nonfiction is known for its educational and informative nature.
Nonfiction is the proper and widely used expression to describe literature or content that is based on reality. 'Non-fiction' is not a standard way of writing it. Nonfiction often aims to provide insights, knowledge, or a true account of something.