why is it when we cook something sour like plums, it will tend to become sweeter & lose its sourness.

Chemical reactions. When we cook anything, the tartness usually flavors down and the natural fruit flavors and inherent sugars expand their presence.