Agility is a combination of speed, power, balance, and reaction time. If you look at an old textbook (or even a new one) it probably says that agility is “a change of direction at speed”, but this is actually only a partial definition. The full definition is provided by Sheppard, who defines agility as (underlining mine):
‘a rapid whole body movement with change of velocity or direction in response to a stimulus
This means that in order to test agility the athlete must not know what is about to happen. There needs to be a stimulus that occurs, which results in the change in velocity. Such as stimulus is normally a defender or object in sports performance. Such that an athlete who is agile will be able to respond to the defender by either speeding up, slowing down, or changing direction.
Agility will influence movement efficiency, as the ability to change direction is built into agility and the faster and more technical your skill in changing direction, the better your agility CAN be. However, agility has a much larger prediction of performance than it relates to movement efficiency. It has been shown that elite athletes have much better agility scores compared to their non-elite counterparts, even if they get the same score on a “change of direction” test, such as a T-test. This is simply because the more elite athletes have a better ability to read and respond to stimulus. In your HSC you will learn that skilled athletes have a great ability to anticipate opposition movements.
The video above reveals more of this, as is shows that the elite athlete actually can read their opposition better than non-elite. That is they identify cues in their athlete (conscious or unconsciously) and respond accordingly. So agility is vital for invasion games where athletes need to pass one another or stop the opposition from progressing. Usually, the stimulus the athlete responds to is his opposition.
Of course, this does not mean that a good agility score means you will perform well in a specific sport. As always, agility comes with the other components of physical fitness to improve performance and relies upon technique and many other aspects of athlete development. Many agility tests are sport specific and are designed using videos requiring a response. See link  below for details of some agility tests.
 Sheppard JM, Young WB. (2005). Agility literature review: classifications, training, and testing. J Sports Sci. 2006 Sep;24(9):919-32.