We tell ourselves a story about what happened (related partially, wholly, or not at all to the facts).
We feel a certain way.
We act based on those feelings.
It is important to note that this entire process takes only seconds to complete and we are largely unaware of each separate step. Also, the story we tell ourselves generally supports our beliefs about ourselves and others (and is incomplete). Consider this example:
Something happens: You are in the conference room p