My suggestion about choosing a research area and topic is to choose something that interests you personally and that you won't mind spending time and effort on. Time and effort for perhaps a significant amount of time. Advisors can be good at suggesting problems worth the effort.
If it isn't fun, it isn't worth doing, personally.
Actually, research in most fields is extremely balkanized. You are likely "competing" with only a few people in a very narrow area no matter what you choose. Math is like that. Better to form collaborative circles and stop thinking about competition. Most of the "millions of papers" are of no interest whatever to nearly everyone else. Some exceptions, obviously.
My own doctoral work was very interesting and significant. But significant and interesting to only about six people world wide, most of them at my own institution. It took years for anyone to decide to follow up on it and more years to find an application. But it was interesting enough that it was remarked upon immediately on publication. So, extreme balkanization.
Moreover, if you do wind up with competitors you are likely to be surprised when it happens and surprised too late to take action. Some people work in parallel at different institutions. I know of a fairly public case in which this happened and two people submitted nearly the same paper to a CS conference based on their independent doctoral work. Their advisors were well known to each other, but no one suspected that the students were working on the same problem.