Why is that when you are exercising you feel like if shit, but after you finished exercising you feel really good?

I started going outside again yesterday and playing soccer with my siblings and I got tired real quick and all that lactic acid started to build which I can tolerate just not when it builds up in my throats that's the worst feeling lol, but then a few hours later I felt really good even though I was soar.
Why is that when you are exercising you feel like if shit, but after you finished exercising you feel really good?
Post Opinion