But the Japanese army broke and collapsed in a few days in Operation August Storm, as did vast swaths of the German Army. The Japanese Army also fell back under heavy pressure in the Dutch East Indies, in New Guinea, China and Burma, and held plenty of retreats in the Phillipines.
They held out until the death on many small Islands simply because retreat was impossible, they had no place to go. Any other time the Japanese, Germans and Soviets behaved the same as any army at a strategic level.
They fled into the jungle when the americans landed at Guadalcanal. The airbase was under construction and had the japanese kept control of it till it was operational, it certainly would have put the aussies in a tight spot. It was a very important position yet they fled anyways.
I guess they retreated when it was possible. Kamikazes only started late in the war when japan had pretty much lost the war anyways and were just buying time and hoping to not get their home islands invaded.