Right- ISO 3200 is about the upper limit for just "good" results from any of the K-5 models, including the K-5 IIs, which I still have and sometimes use. As ISO is set to higher values, some degree of diminishment of image quality will be the price to pay. The K-5 series is among the better models in this regard, but best keeping well below ISO 3200 if possible for better quality imaging. The K-5 series does tend to underexpose slightly, no doubt to protect highlights. Exposure comp up by 1/3 stop will be helpful- but under bright outdoor conditions, or when using flash, even this measure won't usually be needed.
In your comparison here, the subject is the same, but the framing is different. In the Pentax shot, there is a lot more wall around the subject. The wall is very light of color. This creates a different response from the camera's meter. vs. having the subject filling more of the frame. "Seeing" all that whiteness, the meter will seek to "normalize" the overall scene by reducing exposure. This is a similar situation to a lesser degree as a snowy scene where the camera's meter is reacting to all the bright snow, resulting in people with dark faces. The thing to do, of course, is to anticipate the meter's reaction in this scene and increase exposure accordingly. In this case, perhaps just 1/2 to 1 stop would do the trick, while in a snowy scene having a lot of snow with fewer dark areas, 2 stops will likely be needed. Some 50 years ago when I first started, SLR cameras had no auto anything. You set your own shutter speed and aperture according to the camera's meter indicator, and the nature of the subject matter. It was by trial and error to learn when to override the camera's meter indication. In this case, this is your gain of experience in this regard. However, for the comparison of the two images, it would be better to get closer in order to equalize the composition.
By all means, avoid shooting with your mode dial set to the green "auto" mode unless handing the camera to some unknowledgeable person who might accidentally nudge a control and ruin the shot they're trying to take with you in it. This mode makes all decisions, cancels use of all controls, and cuts off the user from making any adjustments. If needing fully automatic setting of aperture and shutter speed, use the "P" setting instead, which allows you all access, including the exclusive Pentax Hyper System. If shooting in the "P" mode, and you want a different shutter speed or aperture than what the camera has chosen, you can simply use your thumb or finger to make your choice and the camera will instantly obey! You then override the camer's automation to take control, and are now in Pentax Hyper Program operation! You can instantly shift into Av or Tv mode without having to first change the mode dial setting before making your selection! Very fast and efficient for making changes on the fly. A touch of the green button restores full "P" operation.
In Manual mode, insrtead of twirling controls to get the "proper" exposure, according to the camera's meter reading, you can simply hit the green button to get an instant meter-centered exposure! Great for quickly taking spot-meter readings around a scene. Then if wanting a different shutter speed or aperture than is already set, first hit the AE-L button to lock exposure value, then go ahead and make your choice via thumb or finger and the other will folllow along to preserve your exposure value! This is the Pentax Hyper Manual operation.
With the DA 16-45mm, the main factor you've gained is more wide-angle capability. But there are much better options for this need. I have the Sigma 10-20mm F/3.5 EX DC HSM. If you like WA shots, as I do, it is absolutely wonderful! With patience, you should be able to find one on the used market in fine condition for a reasonable price, but when on a limited budget, one must save up and get there eventually- one lens at a time.
In the meantime, I would recommend getting the DA 18-135mm DC WR lens and selling the DA 16-45mm lens. Much more versatile and useful. Can even do very good closeups. On the K-5 IIs, very fast, quiet, accurate AF. Well-built with WR construction to go with that of your K-5 IIs. If you are under drippy, misty conditions, you can then take shots without concern. Just wipe everything off after returning indoors. I advise getting a new one, because if carried habitually on a strap pointing downward, it tends to develop zoom-creep over time. I've had mine over 10 years, used on a number of bodies, yet it has no zoom creep and remains just liike new. I see B&H is currently running a sale on this lens for $80 off-which dosn't happen all that often. In fact, this sale temps me to get out a credit card and get one as a gift for a dear friend who shoots with a likewise older Pentax DSLR, as it would be much appreciated. The way to protect your gear and also prevent zoom creep is to adopt my habit. I nearly always carry my camera/lens in a cross-shoulders strap & belt-loop holster-type case. A medium-size would do fine for this lens and your others as well. Be sure to get one having the belt loops too, as this increases stability while walking, bicycling, etc. The ones made for mirrorless, for some reason, have only the shoulders strap. Check out the thread in this section "DA 18-135mm DC WR- Show us what it can do" to see many image examples from happy owners. Start with the most recent postings and work backwards.
Your K-5 IIs is a fine camera. The "s" means it has no AA filter, which is usually found as standard on a DSLR of any brand. This filter is there to reduce moire where it is likely to occur- which is not often. It does this via a slight smudging of the moire so it is less visible. However, that filter can also slightly smudge fine detail in many images. Nikon might have been the first to offer their same model without the filter as an option. The Pentax designers apparently thought this to be a good idea, hence the Pentax K-5 II and K-5 IIs. In fact, Pentax engineers evidently, after much testing, have thought this so important, that no subsequent Pentax DSLR models have emerged with the AA filter! Instead, Pentax engineers developed a switchable filter-substitute which can be switched in if needed! To my knowledge, no other brand offers anything of this sort!
Being that your K-5 IIs is a former Pentax flagship, as such it has its "normal" setting of sharpening for JPEG images coming in conservatively low. You can rectify this by modifying settings in the Custom Image menus, especially in the most often-used "Bright" category. You can access these menus via the button to the right of the "ok" button. It might already be on the "Bright" category by default. Go down to the Sharpening adjustment, and you'll see it is already up by one notch, which is default for this category, since it is shown in green. Then, increase this level by yet one more notch. Then- very important- also implemant "Fine Sharpening" via the thumb dial. This will refine sharpenng adjustments for better detail in JPEG images. Once this is done, just hit "ok" and shut off the camera. Turning it back on restores normal screens.