1). You Know Something Enough; You feel A Need to Put it in Writing for Posterity Sake:
Here most text books and academic instructional guides fall under this category. Usually written by industry experts who lay bare hard empirical data for the readers education and enlightenment.
2). You Have Discovered A New Idea or Invented Something Worth Sharing :
New findings in a niche can become the reason for a writer or a group of researchers to decide to publish a book. In this case the individual or the group have developed a new method of doing something that is worth sharing to the general public.