There are many ways in which an attacker may be diverted or made to hesitate and thus open a window of opportunity for your defensive actions. These may be external (from your actions) or internal (from the actions of the attacker). Either way, the attacker becomes preoccupied and, as a result, he or she is no longer totally focused on you. Some internal factors that influence an attacker are:
In addition, you may create hesitation through the external interjection of pain or by expressing self-confidence that creates doubt or indecision, which may also open a window of opportunity.
In the animal kingdom, windows of opportunity are not usually created, but are instinctively understood and acted upon. For example, the cobra has but one adversary, the mongoose. The mongoose knows that a cobra strikes in one direction (forward) and with total commitment, so it maneuvers itself in such a manner so as to instigate a strike. Once the strike is initiated, the mongoose scurries behind the cobra’s neck. This is a good example of "attack by drawing." As humans, our instincts are less developed so we must create our own windows of opportunity.
Your mindset (coolness, confidence, anger, killer instinct, etc), helps keep you one step ahead of an attacker because it helps you control the mindset of your opponent. Your mindset helps you to create and react to windows of opportunity.
Mindset + Window of Opportunity = Victory