It can’t be stressed enough, but it’s meaningless to use the term “Japan” in this context because the Japanese government and military institutions and key individuals were divided and remained so up until the day the decision was made to accept the Allied terms of surrender. Because of the nature of the Japan at the time, there simply wasn’t one individual with the political authority to make that decision.
There were individuals in the government and military or close advisors who recognized as early as a year before that defeat was inevitable. However, generally the military, especially the IJA, believed that if they just had one good battle with the US, they could inflict enough damage that the US would accept better terms than an outright surrender.
They failed to deliver this at the Philippines or Okinawa and the Emperor had started to doubt their ability to deliver a “crushing blow” during an invasion in the Kanto area. Nevertheless, the IJA either kept believing that or just clung to that out of desperation.
Prior to the August 6th, the “peace faction” in the War Council was suggesting surrendering with the conditions that the Emperor be allowed to remain, and also to let Japan retain its kokutai
The war faction didn’t want to negotiate an end to the war and like a compulsive gambler down on his luck, had complete faith in one more victory which would turn it all around.
After the “Twin Shocks” of the two atomic bombings and the Soviet entry into the war there were discussion in the government in the two essential bodies. The Cabinet needed to formally agree in order for the surrender to be a legalized agreement. The more powerful organization was the Supreme Council for the Direction of the War (Supreme War Council) which I referred to in my post above.
The Hawks in the War Council, General Anami, General Umezu, and Admiral Toyoda, introduced three additional terms: that Japan disarmament itself, that Japan deal with Japanese war criminals, and that the Allies do not occupy Japan. At this stage, it’s hard to see any of their thoughts as rational.
Foreign Minister Togo, the chief proponent of accepting unconditional surrenders, with the only condition being allowed to retain the Emperor, was concerned about the utter destruction of the Japanese nation and people.
The Emperor seems to have been very concerned about retaining the role of emperor. One of the concerns of him and his closest advisor, Lord of the Privy Seal Kōichi Kido was danger of the people turning against the emperor, that if Japan didn’t surrender, then the hardships on the people would cause them to reject the emperor but demanding that the government surrender without the buy-in of the military, especially the IJA, they would be faced with a coup and that Hirohito would be replaced by a most hawkish relative.