Some authors study the market with the goal of determining what is likely to produce the most sales. Writing is a business, their business, and in order to keep doing it they need to make a certain amount of money. Life isn't free. This is why you see a lot of book clones, in both content and front cover, attempting to ride on the coattails of a best seller. Think of the Twilight series or Fifty Shades of Grey. Before long, vampires and erotica swamped the market.
Were they successful? In my opinion, to some extent, some were. I don't think any exceeded the originals in sales but some made their writers considerable money. In the case of vampires, I believe that trend is cooling a bit but erotica is perennially popular. I've read opinions that one of the reasons Fifty Shades of Grey was successful was the timing. E-readers had just come on the market as had on-line marketing and discreet and private ordering and reading was simplified.
I admire writers who can switch genre in response to market demands although not all can do it equally successfully. I can't help but think it must be difficult and a denial of natural talents to force creativity into genre constraints. But maybe the reason some of the great masters of music and literature laboured in penury was because popular taste hadn't caught up with their talents. If only they had spent their time emulating the best selling works of the day; just think of the sumptuous life they could have led. Poor Stravinsky, booed for his Rite of Spring while Claude Monet's work was dismissed as 'mere impressions'. That's what they got for not following the trend of the day.