Why does sex cure all of our arguments?

Looking back at me and boyfriends arguments, disagreements and broken feelings. Once we have sex, we can communicate what's on our minds. If and when we get mad at each other... we have a couple of days of not talking to each other, sex it out and/or then talk it out visa versa. Why is that? For example, one time I was really upset with him for being an arse, I came over and he took me upstairs. We laid on his bed and talked about it. We cuddled and we made love. How come everything is settled and feels better afterwards, like everything is going to be okay?