Apple raised the prices of its Macs by 15% to 20% and iPads by 15% to 25%, attributing the increases to the surging costs of components.