The normal kneecap (patella) moves up and down over the knee as we bend as straighten the leg. It follows a track of cartilage and bone as it glides and slides with knee flexion and extension.
A band of tissue called the retinaculum along either side of the patella help keep it in the center. If the retinaculum is too tight or too loose on one side or the other, then the patella can get pulled too far to one side (usually to the outside or lateral edge). It can be serious enough to cause subluxation or even dislocation. And it can dislocate over and over causing pain and loss of function.
The physical therapist will show you how to tape the patella to keep it tracking in the middle. You will be given supervised exercises as well as a home program to follow. The idea is to strengthen the quadriceps muscle to the knee to help realign the patella. The goal is to have a normal resting position for the patella and normal tracking during movement.
The therapist will make sure the other muscles around the knee (like the hamstrings behind the knee) are also in balance. And the PT will help you "retune" your knee. Sometimes after injury the joint doesn't always know where it is as it is moving. This can contribute to some motor control problems and add to the mix.
You should allow at least three months of consistent rehab before evaluating your results. If you are making steady improvement, you will want to continue and/or progress the program.