One might also say that giving guidance at the start of the quarter is just slightly harder than giving guidance long after the quarter has finished. And one might say that Apple's management are absolute wizards for producing $2.5 bn more sales than they predicted.
Then of course, the management know much more about company's business (contracts etc.) than any analysts and way ahead of those. It's really easy to beat your own estimates - just make them artificially low (and this is exactly what Apple always does).