They were fighting a different (but related) war. In their imperialism Japan had invaded China and were fighting against them. While at the same time Europe was fighting each other. US was more or less doing nothing for a couple of years.
Then, the Japanese attacked Pearl Harbor, (7 December 1941) and Hitler declared the war on the US a couple of days later, forcing the US to enter WWII.
The Japanese didn't want the US to interfere with their interests on south east asia (the Japanese had planned actions in overseas territories of UK and the Netherlands). The pacific war was a different one than the WWII, but they merged..