Japan does not have much in the way of mineral resources. The Japanese were content living insulated from the rest of the world on their islands until foreign powers began to make moves to force Japan to open up to the world and trade under conditions unfavourable to it in the mid 19th century. They knew that they were on their way to becoming controlled by foreign powers. It was at that time, in the beginning of the Edo period when Japan launched a thorough modernization program. They sent their brightest to study abroad. The goal was industrialization. Key institutions of Japanese society were modeled after European great powers.
The reason why the Japanese were so successful at this is because total dedication is part of the Japanese mindset. In feudal Japan, it was a samurai's duty to be totally loyal to his lord to the point of taking his own life if the lord perished in battle. Japanese society and values still echo the feudal times that only ended about 150 years ago. Total dedication to excellence is what drives the Japanese technology sector. According to consumerreports.org there is only one car make more reliable than Toyota. It is Lexus, the luxury brand of Toyota. Japanese car makers take quality more seriously than anyone else.
I think the main reason is the dedication and investment that the Japanese made since the beginning of their industrialization, after all Japan went through a dark time where it served to reinvent itself as a nation and at the same time grow exponentially to a disproportionate measure.
One of the things that it highlight and that have undoubtedly contributed to its technological growth is that they has a system of education at basic and intermediate levels that are extremely incredible, hence the Japanese from an early age may be able to develop projects.
Another factor that undoubtedly I think helped to consolidate its technological growth was the rivalry with the other Asian giant (Chinese), because after all you can not let your main rival in commercial terms easily surpass you. So a conglomerate of rivalry, education and constant investment and incentives have made Japan a global technology giant.
Because they are geniuses. I thought this was common knowledge by now.