When my second child seemed to be pushing my buttons all the time, my midwife suggested the book "Parenting from the Inside Out" by Dan Siegel. It was a fascinating read about the role of implicit memory and mood regulation, and I've given his work a lot of thought over the years as I navigate relationships.
One premise of Siegel's work, and the work fo many, many others, is that memories are stored in our bodies as feelings, particularly if the events happened before we had words to describe them, or they were repeated with strong emotions. One woman recalls hating shoe shopping with her kids, though there was no logical reason why she should - the kids needed shoes, cost was not a concern, she didn't hate shopping in general. Eventually one of her kids noticed and asked, and she remembered that as a girl her sister had narrow feet and thus got to pick her shoes out, while she had regular feet and had to take whatever was available on the discount rack. Once the mom remembered this (funny how we "forget" these things), she was able to separate her childhood experience from her present experience with her own children, and enjoy show shopping like she wanted to.
While no theory has full explanatory power, I've found this a useful line of thought when emotions seem to "come out of nowhere", especially in circumstances that seem illogical. For instance, when I took my kids on field trips, which I loved, there would often come a moment of intense sadness or irritation after several magical hours in front of museum exhibits. At first I chalked it up to fatigue, because of the energy and attention required to steer kids, plan snacks and bathroom trips, etc,... But eventually, when all the logistics were second nature, and I could easily pace myself through familiar, favorite museums, so that fatigue wasn't an explanation, and it STILL kept happening, I connected the dots.
My mom had often expressed regret that she didn't enjoy her time with her kids more, feeling that there was so much housework to do and not enough spare money to travel easily. As a teenager I thought, "So what? Just accept the fact and move on." Super sensitive, I know. But I suppose her regret must have touched me more than I knew, and I also would have liked to have more carefree fun with her. Because here I was having fun with my kids, and suddenly feeling very sad in the middle of a wonderful day. I suppose I had some childhood feelings of regret, mixed with more empathy now that I was a mom and could appreciate her struggles.
While logically I could have stated "I like to do field trips because it's fun for the kids", it would have taken me more probing to say "I plan field trips because I didn't get to do these things before". As it turned out, the wave of emotion told me to pay attention. And once I paid attention, the wave of emotion faded, and now I can just enjoy the trips with the kids the whole time, with a moment of gratitude that circumstances make it easy for me to travel.
I witnessed another, more dramatic, case at a party several years ago. The hostess's parent was fussing at the kids for splashing water in the drink buckets, and after a few rounds of this, the hostess completely lost it. This sweet, ladylike young woman spewed profanity at her fussy, now bewildered parent, shouting that it was HER *%$@ house now and to LEAVE THE KIDS ALONE.
An awkward half hour followed, but it was no mystery why, after being heckled to be tidy throughout her childhood, and attempting to be the good, compliant daughter for so long, she snapped when she saw another child, in her own adult home where she makes the rules, being heckled the same way. She was ashamed of her strong reaction, and theoretically it would have been better to set the boundary under less dramatic circumstances, but there it was.
So next time you have a wave of unexplained emotion, pause and think about what kind of story might be imprinted to provoke such a reaction. Finding the answer, and switching the experience from an implicit to an explicit verbal memory, allows the intensity to fade. Good luck!