Let's say I try to take a picture of the following scene: a nice, blue river on the bottom and a solid, grey building in the middle. It is a sunny day and I am in a large distance, so both "objects" are in the same distance for me. When I focus on the river (80% of the picture contains the river now) — I hold the trigger so the picture remains focused on the river — and I move upwards on the building (still holding the trigger), the picture is generally lighter (or differently lighter) than when I do the same vice versa; that is, focus on the building first and then move the picture downwards on the river (then, the picture is darker).
What causes this issue and how can I intentionally control this behaiviour?
My camera is Olympus OMD EM10. I use autofocus.
This happens because (by default) a half-press on the shutter not only sets the auto-focus, but the auto-exposure as well. If you don't want to set the exposure or focus manually, you can set one of the function buttons to activate auto-exposure lock ("AEL"). With this setup, you would point the camera at the object you want to expose for first, push the AEL button, then use the half-shutter-press to auto-focus as you normally would, allowing you to recompose if you want to before releasing the shutter.
It sound like your camera is locking the exposure in addition to the focus when you perform a half shutter press. This would explain the overexposure when moving from a dark river to the bright sky: the camera is set to expose a dark scene properly, but it then gets pointed at a brighter scene, and subsequently over exposes. The converse is true as well, moving from a bright area of focus/exposure to an overall darker one will underexposed the image.
From what I can quickly tell on mobile, you can set one of your function buttons to AEL, which stands for auto exposure lock. Generally the way this button works is you point the camera at the object you want to properly expose, press and hold the AEL button, and then recompose to take the picture. Your manual or a Google search should provide specifics on how it works.
In your example, I would frame your final picture and lock the exposure, via AEL, so the overall image is properly exposed. Then focus on the river or building, and finally recompose to your original framing to take the photo.
In a situation like the one you describe though, generally virtually moving the focus point over the object of interest is the easiest option so that you can focus and expose in one step.
Your camera is locking both focusing and metering with shutter button half-press - focus lock is called AFL, metering lock is called AEL.
You do not need to use additional buttons for that at all despite other suggestions.
Another trick, which avoids changing settings but is easier with a tripod is to autofocus, release, flick the switch on the lens to set manual focus, then recompose and shoot.
I sometimes do this, or occasionally change focus point, but I prefer a half press to lock the exposure as well as the focus (if the background is lighter than the subject it's often a white backdrop that will eventually be blown out and cropped or made transparent).