Check out Gerhard Weinberger's "world at arms", and Overy's "how the allies won'.
From reading those and various other authors such as Costello, Spectre, & Keegan... it seems to me it was a confluence, or accumulation, of factors, namely -
1) although the Pacific bases had been lost, the IJE still retained a (sort of self supporting) million plus plus man army in China, Indochina, the NEI and Manchuria, and although its shipping capacity had been gutted, there were still resources available if they could get them through the blockade - so the first factor is the USN submarine, and later air campaigns to blockade Japan, to the point where it was hard for them even to ship stuff a short distance from Korea. An important part of this is the aerial mining that sunk a lot of Japanese shipping. So Japan is unable to feed its civilians, let alone train its aircrews and maintain a high rate of aircraft production. What aircraft they do have perform below par because low octane fuel. Shipbuilding has been virtually halted. They don't have the metals to build many tanks.
2) The USAAF has, to borrow Overy's phrases, turned Japan's cities into "open crematoria". Apart from destroying housing and dispersed cottage industry and further suppressing economic activity, the point to be made is that they were doing this with massed fire bombing raids, and while the two bombs must have had a shock effect, the destruction of significant portions of an entire city with a tragically massive death toll was not a novel experience and was being achieved with more conventional weapons.
3. When the Red Army waltzed through Manchuria into Korea - and met up with its PLA allies down near Beijing, and could fairly obviously keep going as far as railway supply lines could provide for it, the IJ Army referred to above is taken out of the picture, and the resources on the Asian mainland are lost. So in that sense, it was the end of what hope was left for holding out.
4. I have seen it asserted that the IJ were happier to surrender to the US and keep the emperor, than have the Red Army setting up "North Japan" as a socialist state on Hokkaido post war... not sure about that, it smacks of cold war rhetoric and hindsight.
"You may find that having is not so nearly pleasing a thing as wanting. It is not logical, but it is often true."
- Cdr Spock