The biggest bottleneck I see that prevents people from being able to do this is their code-reading skill.
With practice you can read and understand codebases much, much more quickly than most people (who are so intimidated they never even try). Once you can do this, you can very quickly pick up (1) the rich details about how the system works, (2) the ability to extend the system and fix bugs in it, (3) understanding of what is idiomatic and what is not.