Some people just pick a topic that sounds really good (but then probably get a bit bored with it). (25%)
Some people pick a topic that sounds important and then say they are really excited about their topic, and that everyone else is really excited about their topic, so that people think they are amazing, and this kind of has a snowball effect. (10%)
Some get quite obsessive about their topic to the exclusion of a lot else in their life. (10%)
And yet another bunch of people actually are quite brilliant, and pick amazing topics. (5%)
And then there are a whole bunch of other people who have pretty ordinary topics. (50%)
The choice of topic is crucial however. Don't pick something for no reason, and don't be afraid to change. Look for something that connects with lots of other areas - think of a network diagram - you want to be working on something that is on or connected to a hub node, not ending up as some kind of add-on to an add-on (this is the problem with being too specific). Do (and this is the tradeoff) make your topic tractable - you have to have a good plan about how to get the job finished in the time you have - remember you just need one good paper, where you really nail a single study, to show (and learn) you are capable of really high-quality research. Pick something you find fascinating, or highly important to the world, or that you think is worth the pain, and it will make it easier to finish when you have to go through the pain.
In contrast to the other answer - I'm not sure professors will help you too much. They will mainly try and recruit you to work on a topic they find interesting, but then you will want to refocus your efforts, and your professor will disengage from the project. There's a bit of a power struggle which can be a problem. Instead - present a really clear plan of what areas you want to work in - with all the uncertainties laid out.
Feel free to ignore any and or all of the above as well.