The position of your hands is the most important factor. Why? Because that determines where the downward force of the weight is concentrated.
Close grip benches work the inner pecs because those muscles are in the best (most direct) position to counteract downward force of the weight. Wide grips work the outer pecs for same reason. Ditto for inclines (upper pecs) and declines (lower).
Of the two exercises shown, the stability ball pushups would be better for upper pecs. Elevating the legs moves the guys' center of gravity towards his head so, naturally the hands would move up higher towards the upper pecs. The other exercise moves the center of gravity to the guys' feet. So, he has to compensate by moving his hands lower and therefore works his lower pecs.