When I read about how Japan had planned to fight to the very last man on the home islands, I can’t help but be confused as to why two bombs, which had done less damage than the bombings of Tokyo, forced them to surrender. Did they have any foresight as to whether the Soviets would invade?
The situation within Japan prior to the events of early August 1945 was pretty complicated. See this recent answer here which goes into the different views on surrender by the Supreme War Council.
This is a different question than whether the atomic bombs caused them to surrender or not (you can find discussions on that here if you search for the term "Hasegawa" in the search engine for the sub), and different from the Soviet situation (they did not have foresight about the Soviets invading, but the Soviets declared war on Japan immediately after the Hiroshima bombing, so the events were closely linked).
Separately, just to address why two bombs might be considered more disturbing than the firebombing: the firebombing took several days and, after the first few mass surprise raids, the Japanese got pretty good at mitigating their effects (the average mortality of the attacks went way down). The atomic bombs had much higher mortality rates for areas affected (if you scaled them up to cities of the density of Tokyo, they would have been much more deadly by far than the firebombing), but more importantly, they could not be effectively mitigated (they were a mostly instantaneous form of destruction). Separately, the threat was not of two atomic bombs, but of a lot more of them — indeed, the US plan (which the Japanese did not know) was to produce 3.5 atomic bombs per month. So that is a pretty extensive possibility for destruction. But again, whether the atomic bombs are what caused the Japanese to surrender or not is a topic of extensive and probably unresolvable historical debate (the main alternative candidate is the Soviet declaration of war and simultaneous invasion of Manchuria).