I don't think Amazon really "understood". It's more that (according to "The Everything Store", anyway), accidentally, some emergency servers were reprovisioned as servers on demand for a bunch of frustrated devs who couldn't get resources the traditional way. And then demand just exploded and they thought why not sell it and see what happens.
It is true that Bezos appears to have a knack for spotting great products that appear accidentally in his org tree, and spinning it out as a separate team (e.g. the A9 team, Kindle...) but it might be that he thinks like a VC and backs everything that looks interesting instead of letting the bureaucracy kill it, and hindsight is 20/20...