There are garbage books in bookshops. Half of big publisher books don't make their advance in royalties. Maybe less than 1% of books make a living wage for an Author.
Also some top selling books (Successful books are about 0.1%) are total garbage, just a success by accident or media hype.
Some useful free titles
https://www.smashwords.com/books/view/305
https://www.smashwords.com/books/view/145431
There is no magic recipe. You need good content (that's a lot of experience and hard work), marketing, good presentation and a lot of luck.
As with almost anything else entrepreneurial, the ideas are your internal motivation, not much to do with the success.