We (US) had blockaded Japanese shipping because of their invasion of China & their other neighbors. Japan has no natural resources so in their bid for world dominance they needed things to feed their war machine. Rubber, oil, rubber, slave labor you name it they took it. We along with other countries said stop they laughed at us & said right. They figured that if they could disable the US Pacific fleet it would buy them enough time to take over their part of the world. They came very close but underestimated the sleeping giant-us
The Japanese bombed Pearl Harbor because the Japanese military controlled its foreign policy and the US had for years cut off Japan's access to raw materials. Japan was competing with the US for raw materials for its industrial base. The US navy was the instrument the US used to deny Japan access. The naval command was based in Hawaii and Pearl was the main naval base.
They wanted to make a preemptive, surprise strike against the U.S. and destroy their fleet of aircraft carriers so they could control the Pacific Ocean over the course of WWII. By pure luck, all the carriers were gone from Pearl Harbor at the time of the attack but large numbers of other naval vessels and crewmen were there for the attack resulting in a large loss of life and military assets.
alot of them thought that there was a war coming anyways so they thought they would go ahead and try to cripple the us pacific fleet to give them some time to dig in to any positions they had and get any other positions they wanted Alot of the japanese commanders thought that bombing pearl was a huge mistake and openly spoke out against the idea saying things like bombing the us will awaken a sleeping giant and thought if they went through with the attack that they would have roughly 3 to 5 years before being beaten back to mainland japan