The emperor of Japan ordered the people directly to surrender and accept/endure their fate. The Japanese people held the emperor in extremely high regard and this was enough to ensure that things were peaceful. It also probably helped that the people were starving and tired of fighting.
http://en.wikipedia.org/wiki/Surrender_of_Japan http://en.wikipedia.org/wiki/Gyokuon-h%C5%8Ds%C5%8D
Was Japan prepared to fight the US to the last woman and child in 1945?
Checkout "Embracing Defeat" by John W. Dower. The Japanese Imperial government was pretty oppressive towards it's civilians and troops, so many people were relieved when the war was over.
Americans also thought Japanese civilians were a lot more brainwashed then they really were.
I suggest that the official propaganda of the ruling elite is not the same as the real feelings of the Japanese people. This is particularly so because the ruling elite had got itself into a bad situation where you could get into Serious Trouble for being perceived to show anything less than perfect devotion to the idea of victory; in 1932 the Prime Minister, no less, had been assassinated for, apparently, being too liberal. So the official propaganda is not even much of a guide to what the government was actually thinking in 1945; there were probably a considerable number of sighs of relief at the Emperor's edict at every level in the government. The fight-to-the-end stuff had been produced as much with an eye on domestic politics as with a view to impressing the Americans.
Amazing how often Anami Korechika and his clique are mistaken for "the Japanese leadership" or "the Japanese people." Kantaro Suzuki, Prince Higashikuni, Marquis Kido, Fumimaro Konoe, and many influential members of the Supreme War Council were suing for peace, some before Potsdam, some had never wanted war in the first place. Simply promising not to prosecute the Emperor and allow him to continue on in a constitutional capacity would have instantly ended the war. The War Ministry's undue influence is just further representative of how far the Army and Navy had been out of control since the early 30's. Hirohito's August 15th address contributed to soldiers lining up on both sides of the road to welcome MacArthur, the "new shogun," and many of the decisions at the IMTFE and elsewhere to sweep Hirohito and officials' actions under the rug while scapegoating figures like Yamashita Tomoyuki helped smooth over the transition under SCAP and GHQ.
Japan was needed as a bulwark against North Korea, the PRC, and Soviet Union, and MacArthur was certainly not inclined to radical politics. Article 9 of the revised Constitution famously forbade war, and the exhaustion and shock of defeat took most of whatever fight was left out of the people. The Shinto Directive by SCAP killed off state support for Shinto, though of course militaristic elements still coalesce around the Yasukuni Shrine. The "prepared to fight to the last woman and child" is mostly nonsense; there would likely have been a spirited but futile resistance in the mode of the Battle of Berlin. Far worse would have been the mass starvation had the war continued. MacArthur kept the Emperor in place in a constitutional, non-divine role, the economy took off shockingly fast, Article 9 of the Constitution outlawed war as a tool of policy, and the people began a reappraisal of all the nationalism and militarism since the Sino-Japanese War in 1894-5. I researched a thesis on the IMTFE, but since you're a priori assumed to be an irresponsible fool without a link, here.
The simple answer is that the idea of fighting to the last woman and child was always propaganda. The regime maintained its power through a whole array of measures of coercion and propaganda, however it is faulty to simply assume this was as effective as the regime claimed it was.
Japan was never a totalitarian regime in the same way that other contemporary states were, and in one sense what happened around the surrender was moderate politicians and military commanders being able to 'wrest control' and push the surrender through. The militarists' failure in the war had largely turned the populace against them and there wasn't much appetite for their ideas.
Practically, the Japanese military was demobilised incredibly quickly, and co-operated in helping occupation forces secure military matériel. 3.5 million men were under arms in the Home Islands at the surrender, and 83% of these had been demobilised by October 15 with the remainder by the start of December. Japan was secure enough that the US was able to halve its occupation forces on paper and send the Sixth Army home.
I've heard it been argued (in better words than i can muster) that it's partly due to the US occupation being so peaceful with an eye on sensible constitutional reform reform and no long-term ambitions to stay.