Is the correlation between learning a subject and having high grades strong? I've found myself in a paradoxical situation. I have failed modules over and over, many modules, some modules more than once. One of the failed modules was introduction to computing. After passing it I felt an urge to write lecture notes because I though that the "official" lecture notes made by two teachers of the computer science department were too shallow and unappealing. I took some time to write it and publish in a free webhosting service. 

Now I'm feeling like continuing that type of work, expanding it to more modules, such as physics and calculus. It seems that explaning things with plain english, doing comparisons and following a straight path is kinda easy for me. Although I did fail so many modules so many times.

Is the correlation between learning a subject and having high grades strong?

Conversely, is the correlation between not properly learning a subject and having really bad grades strong?
There's no general answer to the question. It depends on the individual course.


If the course is designed so that grades are earned for demonstrating achievement of a learning outcome, then there will be a strong correlation between having high grades and achieving the learning outcomes of the course.
If the course is designed so that grades are earned for things that don't demonstrate achievement of a learning outcome, or so that students can achieve a learning outcome but not have an opportunity to demonstrate it to earn a grade, then the correlation will be weak.


Also, your general description of "learning a subject" may not necessarily be strongly correlated with the desired learning outcomes of a course. It's possible to earn a poor grade for a well-designed course even after having "learned the subject" if the course has specific learning outcomes (i.e., "Students will know how to solve a certain class of problem," "Students will have learned this particular skill") and what you are learning about the subject happens to be orthogonal to those learning outcomes.