This grammar point is used when the action shown or expressed in the first part of the sentence (A), creates the result or situation in the second part of the sentence (B). So basically the reason the reason B(result/situation) came to be was because of A(result/situation).
5년 동안 기른 머리를 자르고서 후회를 했다. (I regret that i cut my hair that i had grown for 5 years).
운동을 열심히 하고서 지금 아주 피곤해요. (I worked out so hard that i am now very tired).