You have a scene here of high dynamic range and two extremes of lighting (brightly sunlit and heavily shaded) for areas within the scene. The camera has a problem to properly record all the highlight detail in the brightly sunlit and highly reflective buildings and at the same time record fine detail in the shadowy regions of the tree, which itself is probably not a bright subject to begin with.
I think the result for the first example is about as good as you could hope for. If you'd shot raw then you could pull and push to highlights and shadows to improve the appearance even more, but to me it doesn't look too bad.
For the second image it's quite clear that the exposure has been determined by metering from the shadowy side of the tree. Unsurprisingly everything that is in full sunshine (and more reflective as well) has been overexposed.
In situations like this you need to decide whether the highlight details are more important or the shadow details and set an exposure to meet your aims. You could also consider adjusting your position so that there was a better lighting balance across the scene, or picking a different time of day or different weather and hence different lighting. If your foreground was a smaller subject than a tree - perhaps a person - then you might consider using fill flash to balance the lighting better and lower the scene contrast.
Left to its own devices the camera will simply to try set an exposure that records the metered area as a middle tone. With partial metering this makes the exposure quite sensitive to the aim of the camera and the content of the centre part of the scene. If you point at something bright the camera will underexpose. If you point at something dark the camera will overexpose. You need to take responsibility for the metering pattern you choose, what part of the scene you meter from and whether to guide the camera to a different exposure by using exposure compensation. You should also review the histogram and look for blinking highlight indicators (will need to be enabled in the menu) to see whether and where you are clipping highlights. If you don't like what you see then you will need to make an adjustment in some fashion until you get the result you desire. The results above are not a camera fault. I'm afraid it's a user problem.
p.s. I notice for the second shot that the camera chose an auto ISO value of 320. When shooting in a high contrast situation this is a poor choice as the camera actually shoots at 400 ISO, thus overexposing even more, and then reduces the brightness of the final image slightly to give a result that looks like 320 ISO was used, by which time it is already too late. It would be far better to choose your own ISO value and stick to the whole stop ISOs of 100, 200, 400, 800 etc..
p.p.s. There is a rule (guideline) for digital photography which says you should expose for the highlights and develop for the shadows. What that means is that you set an exposure which preserves the highlight details as you need them and if the shadows end up too dark then you make adjustments in software to brighten those areas. The thing is, only you know which highlights are important within the scene. The camera has no idea. This brings us to Expose To The Right technique (ETTR) which is a technique for capturing as much important tonal detail with a scene as possible while minimising noise in the shadow areas as far as possible. You can read about ETTR here....
http://www.luminous-landscape.com/tutorials/expose-right.shtml
There are also several useful tutorials on the Cambridge in Colour website. Here's an example....
http://www.cambridgeincolour.com/tutorials/camera-metering.htm