I think you need a confluence of fortuitous circumstances to get things like this done:
- You need to have your own psychology in order. A lot of people have things going on in their lives that make it impossible to concentrate on this sort of thing.
- You need to be close enough, background wise. No prereqs -> can't learn this subject.
- You need to be aware of where the low hanging fruit is. This might be some random comment by a lecturer or a line in a paper that makes you investigate something.
- You need access to resources. Anything from a sparring partner to a hadron collider might be needed.
- Timing. Bunch of stuff coming together, might happen 10 years before you or 10 years after.
So there's reasons why undergrads don't always come up with groundbreaking things. Not to worry. You can still try to understand stuff after someone else has found it.