Coming to want to author a book is a slow process. There is likely ruminating, rethinking, internal debating, conflicting feelings, competing agendas, to say the least. Rarely, is it a moment of inspiration and then sudden action. Part of the decision process is thinking about what is already available on the market.
Many prospective authors will say, “there is nothing like this on the market. No competition.” This is very rarely true. There is usually some book, or more likely books, that your idea is standing on the shoulders of, wanting to reach higher. Also, the competition for some customer might be to buy nothing at all.