How did Japanese imperialism come about?

The writer of the introduction of the book I’m reading at the moment* seems to be hinting that it progressed naturally from the army’s role in suppressing domestic dissent such as supporters of the Tokugawa shogunate. If true, it would have interesting parallels with the Spanish Reconquista and subsequent empire. Another similarity would be a country trying to move from intense regionalism towards some kind of nationalist mission. Quite similar to the US moving from finishing off the Wild West and then moving further west to Hawaii and then the Philippines as well.

*The Sino-Japanese War and the Birth of Japanese Nationalism by Saya Makito, foreword by Mitani Hiroshi