From page 501 of Steven Pinker’s 2011 book, The Better Angels of Our Nature:
Animals can attack both in offence and in defence. The simplest trigger of an offensive attack is sudden pain or frustration, the latter delivered as a signal from the Seeking [reward] system. The reflex may be seen in some of the primitive responses of a human being. Babies react with rage when their arms are suddenly pinned to the sides, and adults may lash out by swearing or breaking things when they hit their thumb with a hammer or are surprised by not getting what they expect (as in the technique of computer repair called percussive maintenance).
I came awfully close earlier this week.