Compensation is an essential part of life. Every time you ask your body to move, it needs to figure out the solution, and it's going to take the easiest most efficient solution every time. When everything is working this is great, however when there is dysfunction in the muscular system it can be problematic.
In Biology "compensation" is defined as the improvement of any defect by the excessive development or action of another structure or organ of the same structure1. A google search came up with "Something that counterbalances an undesirable or unwelcome state of affairs." When talking about exercise, compensation occurs when someone loses the ability to utilise one or more parts (muscles) to perform a movement. Other muscles then provide a greater contribution to enable this movement to occur. This may or may not be a big deal depending on the individual, their training goals and body structure.
When injuries develop, your body might not have access to all the "parts" it did before the injury. For instance imagine you've rolled your ankle playing basketball. During the injury recovery process, your body will call upon other muscles to allow you to keep walking while you recover. Once the ankle is back in normal working order, you will hopefully go back to walking the way you did before the injury. If you don't actively work on restoring strength in the ankle, then this compensation might continue and could start to weigh on passive structures of the body (bone, ligaments, joints etc). This can lead to the development of more chronic pain. Hence the importance of improving the contractile efficiency of muscle during the rehabilitation process.
The same thing applies to performing exercise in the gym. If a muscle can't elicit a contraction, then your body is likely to compensate to solve the movement problem you have presented it with. For instance, the above image shows someones knees falling in during a squat. This might be fine depending on the individuals structure, goals, current settings and their capabilities. However instances might occur where this places load on passive structures, pushing them into positions they don't want to go. If action isn't taken to address the limitations in muscle contraction, then this might lead to inflammation and injury of the ligaments of the knee. Note the solution to this problem might not be to simply tell the client to "shove their knees out"... the solution might be to use a different exercise to strengthen the muscles that enable their knee to push out. Ultimately this is something that needs to be addressed through a full assessment of muscle contractile capabilities.
Tips to for when compensation becomes problematic:
1) Focus on of the sensation of exercises. If you're feeling joint pain then something needs to be addressed.
2) Activate muscle before you train. Ensure muscle is prepared for the forces you're about to put through your body. There are plenty of specific activation exercises online and on my Facebook page.
3) Get checked out by a professional who understands how to check range of motion and improve muscle contractile efficiency.