There were a few different reasons for the Japanese attack Pearl Harbor. Primarily, it was meant to remove the U.S. fleet from the Pacific theater, thereby allowing Japan to begin operations against more Pacific Islands such as the Dutch East Indies and the Philippines.
The U.S. had also been worried about Japanese expansion as early as 1931. The U.S. had begun sending support to the Chinese soon after this in the form of aircraft and pilot volunteers. When Japan began trying to capture French Indochina in 1940 western countries began halted export of war materials. By 1941 they also stopped exporting oil, a crucial war supply the Japanese desperately needed.
When this happened, Japan began looking for other sources, and settler on the Dutch East Indies, an area that they would have little chance of holding with the U.S. Pacific Fleet in play. This was when Admiral Yamamoto first suggested that Pearl Harbor be attacked.
There were immediate and far-reaching consequnces for Japan. Immediately following the attack, they ruled the Pacific, and launched attacks into multiple Pacific Islands. They were even able to take the U.S. held Phillipines since the U.S. Fleet was deemed too weak to offer support.
The U.S. declared war soon after this with Germany and Italy supporting their Japanese ally wit similar declarations.
There was a huge wave of anti-Japanese sentiment in the U.S. following the attack, and soon the U.S. began the process of interning it's coastal Japanese population in relocation camps throughout the U.S. The U.S. also began a major program of coastal fortification upgrades throughout the Pacific.
Please see below for a list of resources used in this posting.