After speaking with a couple of people that have ADHD (I've never been diagnosed, though I probably would have been with my behavior and inattentiveness during my school years), I've worked up a pet theory that so-called "ADHD" or "ADD" is what allows people to hyper focus like this. Granted, of the people I've talked to, including myself, that hyper focus really only extends to things they are truly interested in, but it's real nonetheless. I found this out for myself when I got into programming (as stated above).
As for me, I've noticed the amount of time I can focus on something go down a little over the years as well, though I still occasionally get inspired and hyper focus like I used to.