A knee-jerk reaction is an emotional rather than an analytical response to something. The term is named after the response usually caused by the medical reflex test in which the leg jerks forward when the tendon below the knee is struck with a rubber mallet. This is medically known as a patellar reflex and was documented in Sir Michael Foster's 1877 Text Book of Physiology. As early as the tenth century, the term knee-jerk reaction was used figuratively to refer to an unthinking reaction.
Today, many people see this expression used in political debates. One candidate may accuse the other of responding to a certain issue in a poorly thought out response rather than in a way that provides an adequate solution to a problem. Such an accusation then makes the opponent look less capable intellectually unless he or she can then describe how the problem was handled analytically and carefully.
Thinking through problems before reacting impulsively is the opposite of a knee-jerk reaction. Anger management is one example in which people are guided in using critical thinking skills rather than reacting based on their emotions. Critical thinking is the discipline of taking time to examine the situation critically before taking action. A critical thinker uses observation and objectivity to come up with a response to something while a person prone to knee-jerk reactions tends to react emotionally and subjectively to a situation or problem.
In social situations, an impulsive reaction is usually not appropriate as it may cause a negative situation to escalate. For example, if a customer reacts to bad service in a restaurant or store emotionally rather than rationally, yelling or insults are likely to occur. If the customer calms down first and then takes a few minutes to think about the problem and possible solution, the result is likely to be more pleasant for everyone in the room.
Since there are always consequences to any action, a well thought-out response is likely to have more positive consequences than a knee-jerk one. Many people have realized this when they just blurt out something to someone rather than think before speaking. An impulsive reaction doesn't have to be influenced by anger; it could be prompted by any emotion.