Why do changes in inventory affect the income statement?

Ending Inventory = Beginning Inventory + Purchases – Cost of Goods Sold (COGS)

Purchases do not affect the income statement, since they represent purchases of unsold inventory which have not been delivered to the customer. However, COGS does show up on the income statement, since it represents inventory that has been sold and delivered to the customer. Therefore, if we know ending inventory, beginning inventory, and purchases, we can calculate what COGS is, which will directly impact the income statement.