the camera is adjusting it's settings for the bright background. When taking the photo, tap on something closer like a person and it will adjust.
when you tap to focus on a subject, it will automatically expose for that subject as well. It sounds like you were taking fully "auto" pictures where you weren't tapping on the focal point of your photo.
Direct overhead sunlight in the middle of the day is the worst possible lighting for photography. There is very little/nothing that you can do to set correct exposure for everything in a photo. If it is an important shot to you, there are options. There is an HDR app in the app store that helps, but is nearly impossible to pull off if your subject is a person/people. It really only works for landscape photography. Another option is to expose for the subject in your shot, then take the picture to Photoshop and dodge/burn areas in your photo that are too light or dark. I'm not sure that the iP4 flahs is strong enough to effectively be used as a fill flash in harsh sun, so that is out as an option.
In the end, even the most expensive camera equipment struggles in these conditions and you can't expect a phone camera to live up to their performance levels. Besides, I've always thought that the more a photo is altered in an editing program, the more unnatural and worse it looks. Just compose the shot to your best advantage and leave well enough alone.