My knees are still in good shape despite lots of abuse so I must be doing something right.
Four things have hurt my knees:
- Blunt trauma to the kneecap.
This bruises the cartilage in behind the kneecap. It’s imperative to apply RICE (Rest, Ice, Compression and Elevation) as soon as possible for this kind of injury. Go easy on the compression. The cartilage has a very poor blood supply and heals slowly. DON’T do anything to stress the kneecap (e.g., deep knee bends) until the cartilage heals (weeks, not days). I did and the Doc said I was lucky not to have killed it off. That would have been a real mess.
Obviously, good armor would have prevented the injury in the first place, but at the time I was swimming in whitewater. I didn’t know the rock was there. 
- Overuse.
A rule of thumb for racing cyclists is to never raise your milage faster than 10% per week. I don’t know how that translates to unicycling except to say that in bicycling it seems ridiculously slow, especialy early in the season when the weekly milage is low. Anyone capable of riding 50 miles in a week can do 100 in a day, but DON’T! It takes a long time to grow the cartilage, tendons and ligaments to take the strain the muscles can dish out.
For a couple of seasons I didn’t follow this advice, pushed it early in the training season, and wound up in pain throughout the racing season. I had to ice my knees for a couple of hours after each ride just to keep walking. In subsequent years I followed this rule to the letter and never had to ice. I was faster, too.
- Sudden bend/twist the wrong way with force.
I tore my anterior cruciate ligament playing soccer as an old, fat guy. The details are not important - once my ACL was torn it needed to be replaced. The only good side effect of this adventure in pain was to see orthoscopic pictures of the inside of my knee. The Doc says my cartilage is perfect - the bash healed completely, and no visible effects from the overuse when I was younger.
The moral of this story is that if you stop abusing your knees there is hope that the cartilage will recover.
There isn’t much you can do to prevent this kind of injury other than to learn how to unweight the leg and fall before it gets busted. And don’t wear sticky shoes while playing indoor soccer with a bunch of other old, fat guys. They’re clumsy and they’ll pile into your knee by accident. If your foot can’t slip your knee will go “pop.”
- Muscular imbalance.
This one ended my racing career. My outer quads got so strong that they would pull my patella out of the groove when I walked. It was painful. The Doc says that the poor tracking of my patella caused it to load up on only a couple of points instead of the whole gliding surface. It was only a matter of time before I wore through the cartilage completely. His prescription was to stop riding and let my thighs attrophe to a normal size.
I think a stretching program might have helped a tiny bit, but what I really needed was selective strengthening of the under-used muscles. The lesson I learned was to go for variety, not focused mass. For this reason I’m not a big fan of weight machines. Free weights are better, and calisthenics are best. It’s one reason why I unicycle.
Keep your legs strong, don’t bash them a lot, and keep them from twisting under load and you won’t have any problems with your knees. Wear armor and UPD wisely.