The factors that cause your knee to hurt are complex, and despite a lot of research are currently not completely clear. However, the infographic below helps to explain the most likely reasons.
Dye 2005. The pathophysiology of patellofemoral pain: a tissue homeostasis perspective.
Maclachlan 2017. The psychological features of patellofemoral pain: a systematic review.
Powers 2017. Evidence-based framework for a pathomechanical model of patellofemoral pain: 2017 patellofemoral pain consensus statement from the 4th International Patellofemoral Pain Research Retreat, Manchester, UK: part 3.