Hi,
This is a good question. The main reason why your data is different is that the underlying queries issuing the requests in both interfaces are different.
The UI and API both use a common gateway to access 1 version of your data. But the way you issue requests to that gateway can make the data very. You can see this by forming the same API query via custom reports and seeing that the data is different.
In short, the UI screenshot is getting data from pre-calculated tables. And the API query is going back to the raw hits / sessions data and recalculating the data on the fly. There is sometimes a slight delay between collecting raw data and when it appears in the pre-calculated tables...and why you see a slight difference.
-Nick