Political unity and a wholesale commitment by the elites of Japan to technological, scientific, and social change. The Meiji Restoration of 1868 unified a fragmented Japan under imperial authority. This occurred 15 years after the American navy forced Japan to open her doors to westerners. The new government's contact with Westerners convinced Japan to engage in a crash course of industrialization and modernization. Foreign technical experts were imported and paid very high salaries to modernize the nation. Japan sent students to the West who came back with valuable knowledge. The nation's farming was intensified, factories opened up across the nation, urbanization occurred, Japan's economy transitioned from feudalism to capitalism. And all of this in about 30 years time. The main reason this happened though was the unity and reach of Japan's Meiji era power elite.
The field of study of what allows a poor country to become rich is called development economics and essentially studies how a nation industrializes. It's generally possible for a poor country to develop very rapidly if conditions are right. Extensive growth of the sort that gets you industrialized means building new factories, getting more people educations, building up cities, etc is generally just a matter of spending more money and if you can achieve a high savings rate you can do it pretty quickly. Intensive growth is is figuring out how to do things more efficiently rather than just building more stuff and simply spending more money helps but not doubling your research investment doesn't come close to doubling your rate of growth. That's why it's possible for China to grow its economy much more quickly than the US can right now.
The government used its tax income to give loans to businessmen who wanted to open factories as a way of forcing a higher savings rate. One of the first industries Japan went into was textiles like most developing nations today and at the time they imported and processed a lot of raw silk from China. To start with it was mostly young women who were lured to the cities out of the countryside to work in sweatshops by wages that were about twice what they could earn in the village.
With cheap loans from the government and the profits from existing factories the capitalists built more factories which employed more people drawn from the countryside. A limited amount of good land is a constraint on how much a person farming in the countryside can produce so people leaving pushed up wages in the countryside a bit. Eventually there comes a point where factory owners have to start raising wages to draw more people from the countryside and at that point they start investing more in machines that make workers more productive than they had been. These are machines that already exist in wealthier countries so again it's just a matter of finding the money to buy them and there's little of the trial and error involved in growing the economy of an already wealthy country.
Apart from the the bits about silk processing none of the above is unique to Japan and it happened in Taiwan, Korea, and China too. China actually just started to see its urban wages rise around 2010 and that's partially due to the internal passport system they're using to control the pace of urbanization. Vietnam is starting the process but it's still urbanizing.
Sources would mostly be courses I took as an undergrad for my East Asian History concentration I'm afraid. There's a great book on development economics I read a few years ago but while I remember the cover I seem to have forgotten the title. I'll try to find it when I get home.
EDIT: Right, book titles. The one I was thinking of is The Elusive Quest for Growth by William Easterly.