I know that there WAS a coup, but it was small and never had the support of higher leadership. What caused the general military to accept the "unthinkable" and surrender rather than revolt? I'm under the impression that there was a constant fear of a coup.
I'm not an expert in Japanese culture, but my reading around on this question has led me to feel that in the West we traditionally underestimate the importance of the imperial monarchy. We tend to think of it as "just" an Emperor, whereas in Japan the Emperor was not only considered to be literally a god, but the associations between the imperial house and the country of "Japan" were almost absolute. That is, to use an analogy, it would be like a military commander taking over the Presidency of the USA and throwing out the Constitution. The USA self-defines (however confusingly, at times) by the Constitution — if you throw it out the door, it's not the USA anymore, and there is little that could happen that would justify in the minds of most Americans a full-out rejection of the Constitution. (Individual aspects, of course, get ignored all of the time, but consider how much dystopian drama is presupposed on the total destruction of the Bill of Rights altogether.)
Obviously it was entirely unthinkable to get rid of the Emperor. Some of the officers did think it, and there were also fears of Communist uprisings. But for the main generals, to overthrow the Emperor was to overthrow the national religion and to overthrow the definition of the Japanese nation. If you did that, what were you left with? Nothing good — not even military victory would restore that loss of honor, in a culture where loss of honor was traditionally met with suicide.
Frank's Downfall notes that the senior leadership of the IJA had made an accord to respect the imperial decision and carry it out accordingly. Discipline in the IJA and the IJN was extremely strict even by the end of the war. Although there were many incidents where the army would routinely ignore the high command and the government, they would not ignore a directly commanding officer. For instance, an extreme example is one of the last "Japanese holdouts," Hiroo Onoda, who refused to surrender until 1974 when the Japanese government located his former commanding officer and flew said officer to the Philippines to personally order him to surrender.
In addition, while there had been many historical attempts to overthrow the government, there had never been an attempt to oust the imperial family, or for that matter, any Japanese emperor. The 2-26 incident, a similar military coup attempt, was in fact supposed to increase Hirohito's power in what they termed a "Showa Restoration." The only ones who were extreme enough to want an abolishment of the imperial system were the Communists (who incidentally recently dropped that particular part of their platform). Simply put, overthrowing the emperor was unthinkable.
To answer this question, I think a differentiation must be made between the "emperor" as an individual and the "imperial institution".
The primary argument just prior to the Japanese surrender was whether the Americans would allow the Japanese to preserve the "imperial institution", but not necessarily to preserve Hirohito the emperor.
The Japanese responded to the Potsdam Declaration with the condition of the preserving the "imperial institution". The American reply was rather vague and said the form of Japanese government post war will "rest upon the Japanese people". Responding to this vagueness, the emperor was to risk the "imperial institution" to avoid the total destruction of the Japanese people. He also privately commented that he believed the Japanese people will not abandon the imperial institution.
On the other hand, the emperor is expandable. Among calls for his abdication, his closest advisor Kido told him to remain on the throne for his own safety. The prime conspirator of the Aug 14 plot, the night before the surrender, Kenji Hatanaka, had expressed that the "imperial institution" is beyond the "emperor". That the emperor is just one of many in history and he alone cannot decide the fate of the institution. If he is weak (i.e., willing to surrender and risk the abolition of the institution), then he must be replaced. As another example, Tajiro Onishi, the guy who organized the Kamikaze, also privately stated that the emperor was weak, and he should himself board a plane and lead a Kamikaze attack.
With the navy annihilated and its head in favor of surrender, the source of coup would come from the army, and what prevented a coordinated major coup (with the support of the Army leadership) was ultimately the indecision of the War Minister, Korechiko Anami. One week prior to Aug 15, Anami heard the case for coup from the conspirator Hatanaka, who was one of his subordinates at the War Ministry. He did not agree explicitly to join, but asked for a draft of the coup plan. At the last meeting where the Supreme Council agreed and signed for surrender, Anami was being persuaded to refuse to sign. The Japanese constitution at the time require all Imperial documents to be affixed with the signature of the minister of the relevant department. If Anami refused to sign, then the government cabinet would automatically have to resign en masse, therefore dragging out the issue. However, Anami in the end did not wish to personally disobey Hirohito the emperor, signed the document, went home that night, wrote an apology note to the emperor and committed suicide.
Source:
Hirohito: the Showa Emperor in War and Peace. Ikuhiko Hata
Japan's Imperial Army. Its Rise and Fall, 1853–1945. Edward J. Drea.
I suggest you consult the FAQ regarding Japan and the Atomic Bombs for some great answers. This thread in particular has some great answers
Basically by August of 1945 every senior military officer understood that surrender was inevitable. Conventional bombing of Japanese cities had reduced most of them to rubble. The U.S. specifically preserved cities for the dropping of the atomic bombs. All Japanese air forces were being saved for kamikaze strikes. With Okinawa taken the next obvious step was an invasion of the Japanese home islands. The real question was not if Japan would surrender but what terms the Japanese would accept for surrender. The Japanese last hope for any kind of a favorable surrender negotiation disappeared when Russia attacked Japan.
Really the only thing keeping Japan from surrendering was the unclear status of the Emperor in postwar Japan. In the link I provided there is a very good comparison between removing the emperor and throwing out the US constitution. The most senior military had already been given plenty of opportunities to argue their points in front of the Emperor. Once the Emperor decided that he could accept the ambiguous position offered by the United States the senior military reluctantly agreed it was time to end the war.
The war was over. Japan had hoped for some kind of terms but those hopes were smashed by mid August. Russia had shown that it would not negotiate a surrender. The hope to make capturing the Japanese home islands a bloody battle were smashed by the atomic bombs. Truman threatened to systematically destroy every single Japanese city with these bombs. There would be no glorious last battle Japan could only watch as Russian, Chinese, American and British troops wiped out what remained of Japan's army on the mainland and unimaginable bombs destroyed the few cities left untouched by America's incendiary bombing. The higher leadership could see this position. It was the lower ranking officers who did not have all of this information who believed there was some hope left.
The threat of coup was not aimed at the Emperor, or more importantly the Imperial institution.
The threat of coup was aimed at government ministers or the emperor's 'advisers' - removing those trying to make peace and replacing them with hardliners who wished to continue fighting.