The Japanese were always perfectionists, and fanatics for detail, going back hundreds if not thousands of years. Very much like the Germans, the previous dominant power in photographic equipment.
There was already a substantial Japanese camera and optical industry before WW2, but it was not well known outside of Japan. People in the rest of the world did not think anyone could really challenge the Germans in this area.
At the end of WW2, the German camera industry was in ruins, and worse, much of it was in the Eastern zone, dominated by Russia.
Japan was equally decimated, but a few small camera companies like Nikon, Canon and Asahi (later Pentax) rebuilt and were able to take advantage of trade agreements with the US to start exporting their products.
Canon copied the Leica almost exactly, Nikon combined the best features of the Leica and the Contax, and Asahi went off in a new direction, the SLR.
Nikon (and by extension the Japanese camera industry) got a big break in 1951, when photographers for Life Magazine stopped off in Japan on their way to Korea, and bought some Nikon lenses for their Zeiss Contax cameras. The resulting images were so sharp that they stunned the technical staff back in New York, and Nikon’s reputation was made, almost overnight. Asahi sold its first primitive SLR cameras through Sears, under the name “Tower Reflex”, a reference to the German Pentacon brand whose logo was a tower. Canon improved on the Leica design.
Meanwhile, in Germany, Zeiss was busy digging its grave, coming out with models that were either retreads of pre-war designs (Contax II), or wildly impractical and complicated new designs (Contaflex), all at extremely high prices. Leitz was able to retain its customer base with innovative designs (Leica M3), but Zeiss floundered, and the rest of the German camera industry trapped behind the Iron Curtain, ceased to be a factor. The East German Zeiss factory did design the first modern SLR, the Contax S, but it was ridiculously unreliable, and when Asahi copied it and came out with the Pentax, the game was up.