Let us suppose you have a brilliant idea for a non-fiction book. You research the market for that idea, and realise it's huge; so you write your proposal and your sample chapters and send your submission off into the world. And back it comes, on a tidal wave of rejections. What went wrong?
It could be that your idea of a huge potential market does not match the publishing business’s perception of huge.
It could be that you've submitted it to the wrong places: an agent who represents writers of young adult science-fiction isn't going to consider a cookery book, and neither will a publisher of literary fiction.
It could be that you've submitted in the wrong way: if you are asked to send your proposal by snail mail but you've submitted electronically, your submission probably wasn’t even looked at before being deleted.
Perhaps you sent the wrong material. If you are asked for the first three chapters and a proposal which includes a market analysis and marketing plan, then don't send an outline, demand a ghost-writer, and suggest that the publisher could throw your launch party at the Ritz and send you on an international book tour (especially if your proposal is for a book about the canal system of the English countryside). Similarly, while a handful of endorsements by established, well-known professionals might well impress, a list of congratulatory comments from the unpublished writers at your critique group and a blurb from your Aunt Sophie who once had a letter published in the Grimsby Gazette probably won't do the trick.
Finally, if you've put together a carefully-researched proposal in which you've demonstrated a clear gap in the market and have sent it to the most appropriate agents and editors for your genre but it still gets rejected, then there's a good chance that your writing just isn't good enough yet.