World War II, the largest war in history, had multiple wars within it. Along with the fighting in Europe, there was a lot of conflict in the Pacific between Japan and other countries, with the entire war called the Pacific War. The war was instigated when Japan attacked bases in the Philippines (Clark Field- 12/8/41), Thailand (12/8/41), and Pearl Harbor (12/7/41) within two days.
By attacking U.S. bases in the Philippines, and allying with Thailand, they were trying to make the US withdraw, giving them easy access to the resources in Southeast Asia, and they attacked many other allied colonies. Japan was rapidly expanding its empire, and by March 1942, they had overrun Hong Kong and Singapore and seized the Dutch East Indies and Malaya.
As the continued expanding, the U.S. had to stop them, and defeated Japan at the Battle of Midway, and Coral Sea, preventing their eastern and southern expansion, respectively. The US employed the strategy of island-hopping, trying to successively defeat Japanese islands to get closer and closer to the mainland. After the Battles of Iwo Jima and Okinawa, the United States had suffered over 100,000 deaths, and they didn’t want to suffer any more casualties.
Up until that point, the US had been developing a new kind of bomb: the atomic bomb. Called the “Manhattan Project”, it was extremely secretive, and even President Truman didn’t know of its power. So, prior to the bombings, US planes dropped fliers warning Japan to surrender, or else they would deal with catastrophic consequences. They could not surrender, because the terms of the surrender stated the emperor would have to be overthrown. With no surrender, the US dropped a bomb on Hiroshima, then a bomb on Nagaski three days later, and five days after that, Japan surrendered, marking the end of WWII.