" I was racing all last year up to 5 times a week, and training hard. I was NOT overtraining and I thought everything was fine"
This the very definition of overtraining. You developed "Chondromalcia Patella" which is basically an overuse syndrome from excessive stress to the knee joint. This is a pretty common disorder in athletes including cyclist. There is tons of info on the internet on Chondromalacia Patella.
The cause of this is not an abnormal pedaling technique in the sense that anyone who pedals wrong is destined to get it. It is degenerative knee disorder that anyone can get from overuse, injury or sometimes arthritis of the patella.
I hope you are able to get back on the bike ASAP.