Intel still acted like they were the market dictator (which they weren't at that time) and said "IA64 is the way forward, dump x86!" This was astounding from Intel as for decades they had been the key drummer on the backwards-compatible drum, making sure each new x86 CPU could run the old existing code. Now suddenly they're saying dump decades of installed base. AMD took advantage of their increased marketshare and said, "Hey, we have a 64bit solution for x86 that keeps your old code, and lets you create 64bit code for the future without relearning a new, complicated architecture." IA64 was EPIC, meaning Extremely Parallel Instruction Computing. AMD64 was x86 with a whole new set of 64bit extensions but with x86 compatibility and familiarity, which is exactly what Intel did when they extended x86 into the 32bit world with the i386. Those two factors combined are why AMD64 became the defacto standard. Neither would have helped without the other.
Anyone remember Transmeta?
Transmeta had what's known as an exposed pipeline VLIW design. If you tell the multiplier to do it's thing and put the result in Register 6 then you can still read the previous value from register 6 until the multiplication is done. So you always need to recompile for each version of the hardware.
however, while yes the compiler does a lot of work, it's an entirely different method of programming than most coders are used to, which make it painful to change to.
IMO AMD could compete because the manufacturing and design processes were still accessible enough that they could still produce chips with competitive performance without the massive amount of capital Intel invests in new designs today due simply to diminishing returns in processor performance. Nowadays the difficulty of new processes means that very very few foundries are capable of using the latest fabrication processes and Intel has a stranglehold on them. It's harder for AMD to play catch-up, because there is less slack for them to work with using the next-best-thing. Nowadays, all the money AMD could spend on innovating with genuinely new technology is instead spent trying to keep up just keep up, whereas before they had more breathing room.
There's a comparison to draw with the engine wars in Formula 1 in the 90s. The sport was in major trouble financially, because teams were spending gigantic sums of money chasing small gains in engine performance on the extreme tail end of diminishing returns. The small teams were imploding trying to keep up because while the performance delta might have only been a few horsepower between the big and small teams, those few extra horsepower had a big impact on how competitive you were. And engine development is astronomically expensive on the far side of the returns curve, so additionally even the big teams were outspending themselves trying to keep up with each other before they implemented rules changes to limit engine development.