If I enjoy what I do, and I enjoy all classes cause learning to me is like crack, I'll focus well and do well. Also, I have a self-concept that I'm an intelligent person who learns easily. It must have been something right my parents did, because from a young age my parents instilled that mindset into me, and I've been a straight-A student my entire life. Whenever teachers would ask why I did well on tests without studying, I'd always say "I love learning." Maybe that helps, too. It's hard to pinpoint exactly what I do since I've been doing it since pre-school, but I'd pin-point it down to self-belief and a deep curiosity for how everything works, and a love of learning about stuff.
I'd go far to say that this actually has not helped me in certain other endeavors, mainly personal development. All my life I've gotten away with procrastination because I have what society would deem "raw talent" when it comes to school, so I could crank out an essay last-minute and have it sound good. Having such talent had limited my need or desire to discipline myself or to "push" through sticking points. Ask any of the true geniuses in school and they'll probably tell you the same thing. I had to undertake other activities, including sports, socializing, martial arts, etc, in order to develop discipline, a sense of what "failure" feels like, and how to push past that. Go figure