Note that the supply curve depends on marginal costs.
The firm looks at its additional revenues and additional costs when deciding how much to produce.