It generates the AES key from the PIN in combination with a UID fused into the hardware (not the storage hardware, specific hardware location depends on iPhone version). It's impossible to read the UID directly from either hardware or software, only the result of the decryption operation after inputting the PIN. If you pull the storage, there's no way to use the UID.
You can see details in the iOS Security Guide. They're really quite clever.
TPM devices on PCs (and Windows Phones) do the same thing - if you pull the storage from a device with a TPM chip, you can't brute-force the password, you have to attack the AES (or other cipher) keyspace directly.
I see. As I understand it, the crypto processor is integrated into the main processor, so that you cannot separate these two and hook up a custom processor to brute force the crypto processor.
That leaves only attacks on the chip itself, like corrupting the boot ROM, or sensing currents on the crypto processor. In principle possible, but extremely difficult and risky.
As an aside: I kind of like that we are entering a world where private businesses are starting to become too big for governments to contain. With Apple being as large as they are, and the fact that they have more popular support right now than the government, there is a good chance they are going to win this fight and the government is going to be told to sit down and shut up. We need more of that in this world.
I do not like this at all. The government should be contained by the people and governments that overstep their bounds should be voted out of office. Sadly, voters have neglected that duty and the best we can hope for is big powerful corporations to play benevolent dictator. And God help us if a corporations that is too big for the government to contain gets malevolent leadership.