They were arguably the single most serious country in the world about military reforms, benefitted from an unrivaled military ethos, and had the fastest economic growth rate of the time period.
Modernization and military reforms
Contra popular belief, both factions of daimyo (lords) in the Boshin War, which restored the emperor and deposed the Tokugawa Shogunate were modernizers. Both had in the years following the forcible opening of Japanese ports by Commodore Perry hired foreign experts and imported vast amounts of foreign military equipment. The samurai, unlike Western European knights, formed the bulk of armies during the Japanese warring states period, or Sengoku Jidai, and therefore had a more pragmatic warrior code whose primary precept was to prefer death over dishonor. Perry, by opening the ports, had humiliated Japan - this was recognized by the entire daimyo and samurai class. In order to recover their honor, they had to modernize and become militarily superior. The samurai had taken to aggressive modernization once before, during the introduction of firearms: just decades after the arquebus made its way to Japan, the Japanese were producing more of the weapons than all of Europe combined. There were in theory no restrictions on a warriors methods in the ethos in the Japanese military class, just a strong impulse to imitate whichever methods were best.
Because of this spirit, Japan’s oligarchy following the war, known as the Genro, became obsessed with imitating Western ways. They at once hired a Prussian general to establish a War College along Prussian lines, and dispatched promising young officers to foreign countries to study their doctrines. The most important of these were the Akiyama brothers, Saneyuki and Yoshifuru. Saneyuki was dispatched to America around the Spanish-American War, and returned with the concept of naval war games - simulated naval battles in which referees using charts of ranges and probability accuracy determined results. Yoshifuru, meanwhile, was dispatched to France and cloned the methods of the French cavalry, which at the time was the best in the world. While their individual contributions were immense, hundreds of other officers also received foreign training and built an impressive base of military expertise by the late 19th century.
Enomoto Takeashi, the founder of the Imperial Japanese Navy, further encouraged intense historical study, and took the UK as his model. The IJN’s Officers, following the publication of The Influence of Sea Power Upon History in 1890, took the book as their bible, concluding on a strategy whereby potentially superior foreign navies should be lured long distances to Japanese waters, then crushed once they whittle down from attrition. This was successfully done against the Russians in 1905.
The “Japanese Spirit”
One area where Japan didn’t imitate the West, however, was in its military culture. For a while, it seemed like Japan would - the ethos of the samurai class had declined through centuries of peace. The class by 1867 had become little more than administrators, bureaucrats, and duellists, who fought for sport. During the Boshin War, surrenders - which would later become anathema in the Japanese Army - were common, the aforementioned Enomoto Takeashi having been a captured Tokugawa loyalist. The famed Japanese tradition of seppuku, or ritual suicide, had also become somewhat farcical by the late Tokugawa period. Instead of cutting their bellies open painfully with a knife, some men chose to have their second decapitate them just as they plunged the knife in. Other yet chose only to “symbolically” commit seppuku by picking up a fan, at which point their second would decapitate them.
However, the Satsuma Rebellion in 1877 would reinvigorate “samurai values”. I mentioned before that both factions in the Boshin War were broadly modernist, but there was one caveat. Saigo Takamori, arguably the most gifted anti-Shogunate General, and the man who won the war’s pivotal battle, was a fierce conservative. The Genro, all of whom came from the samurai and daimyo classes, moved after the Meiji restoration to weaken their own classes. Saigo, leading an “academy” (paramilitary) of rebel samurai, took over Satsuma domain and created in practice an independent country in 1877. The government moved quickly to crush his rebellion.
Out of ammunition, Saigo didn’t surrender. Instead, he ordered his men on one last suicidal charge.
The Genro were deeply impressed. They realized in this moment that, for all the places Japan was behind the West, it could gain an advantage by reaffirming its old warrior ethos. Though they would soon abolish the samurai class altogether, they soon attributed the heroic values of the samurai to all Japanese, calling Bushido by a new name: Yamato Damashii, or “Japanese spirit”.
In 19th century Japan, there was no cultural concept that a man could be be author of his own fate. Influenced by Buddhism, Bushido emphasized the acceptance of ones fate - especially his death - and the importance of carrying out inevitable actions “in good form”, instead of trying to avoid those actions. The most important inevitable action was, of course, dying, so ones greatest aspiration was to die in good form. This was called Gyokusai, or “to shatter like a jewel”.
Yamato Damashii spread through government propaganda and the new universal education system. An obscure collection of musings from a retired samurai called Hagakure became the most popular book in the country, as the government attempted to instill samurai values in the entire population.
Yamato Damashii would influence every level of the Japanese military, generally for the better. Understanding that the most decisive battles are those where the defender routs or surrenders, the Japanese were able to inflict extra casualties on their enemies through heroic last stands - despite being vastly outgunned, Japanese island garrisons in WW2 generally casualties traded at just under 1 to 1 with the Americans. In the case of Iwo Jima, the Japanese actually suffered fewer casualties.
The concept also gave the Japanese greater offensive flexibility. With no premium being put on minimizing casualties or extensive deliberation, Japanese soldiers, most notably in the Malaya campaign and Russo-Japanese war, overcame superior forces through risky gambits at all levels of command which would have been impossible of junior officers had been more concerned with self-preservation. Finally, since the Japanese were outgunned, the reckless fatalism of their army minimized the impact of enemy artillery by encouraging their officers to close the distance in battle, arriving at ranges where enemy shelling would lead to friendly fire.
Military Experience
A smaller section but no less important - the Japanese fought more wars between 1895 and 1945 than any other country on the planet. Their first major war was with China in 1895, followed by the Russo-Japanese War, Boxer Rebellion, First World War, Russian Civil War, Mukden Incident, Shanghai Incident (1932), Second Sino-Japanese War, and finally the Pacific War. Brilliantly executed maneuvers like the Malaya campaign did not exist in a vacuum - Japanese officers had built up an immense amount of experience which allowed them to be far more innovative during that campaign than their adversaries.
Economic Development
It’s impossivle to analyze Japan’s rise as a military power without analyzing its rise as an economic power. Japanese economic growth was far higher after WW2, but before the war still averaged around 3.5% when adjusted for inflation. In other words, Japan’s growth at a time when most countries were growing at 1-2% was impressive.
Japan’s economy in the Meiji period was largely an accidental success. The modern East Asian growth regime didn’t come into being until Japan’s “Manchukuo experiment” of 1931-45, but the Meiji Genro coincidentally instituted many favorable policies. The question for all “backwards” economies in the 19th and early 20th centuries was not what to do, but where to get the money. So many history books point out that Japan “imported foreign teachers” and “built railways” and so on, but everyone else also did this and didn’t get the same result. Although the Genro resisted foreign debt (today widely regarded by economic historians as a mistake), Japan was able to acquire foreign capital by directing bank loans and state subsidies towards a few light industrial groups called Zaibatsu, who, due to Japan’s poverty, naturally tried to succeed in foreign markets.
An ideal developmental policy patronizes those businesses that have already succeeded in foreign markets. Japan did this accidentally because that was the only success possible for early zaibatsu, and because it for the most part only supported existing businesses instead of creating entirely new state operations. In other words, the Meiji government unknowingly adopted an export led growth model.