I highly doubt that I am special in a way where I have a "smarter" brain. I believe that I simply adapted to learning fast. I was a slow learner and by grades were awful until around 7th grade where I've started to catch up and perform really well in school.

But what you said about homework IS motivation, self-discipline IS motivation. I had zero issues digging into whatever I can find to improve at programming and grasp concepts far beyond what I would be learning at my age. I started programming at the age of 12 which I believe also manifested in the ability to do much better in school.