a lot of leg problems be it foot, knee or ankle, etc come from 1 of 2 things or both of them.
the first problem is unsupported shoes, ones which are flat, have no bump in the middle. think converse, those flat type shoes are the worst thing possible for your legs and knee's. the way the leg works is, that your foot is supposed to absorb most of the shock, then your calve then your knee. by wearing flat type shoes, your foot basically absorbs very little of the shock, meaning you damage your knee's (permanent in most cases, cartilage cannot grow back or be replaced). when wearing the proper shoes with the proper arch in the middle, the foot absorbs a lot of the shock, then the calve and by the time it gets to the knee there's barely anything. thing is though these days companies prefer profit over usability and prefer to make fashionable trainers which absolutely destroy your knee's rather than trainer's which are actually useful.
the other problem is stance and movement, nobody gets trained on how to stand, walk or run properly unless they are a professional athlete. so people just do what feels natural. their natural standing stance may be wrong, their natural walking movement may be wrong and their natural running movement may also be wrong. having the wrong stance/movement again causes damage to bones/cartilage but also your muscles. muscles that you need can weaken causing muscle wastage.
these problems can be fixed by having proper shoes and doing some specific exercises (physio), to correct your muscles and the movement they naturally prefer to move in.