The Mongols failed to conquer Japan even though they had previously managed to conquer Korea and the much, much larger country of China. The major reason for this was geography and a second reason was luck.
Because Japan is made up of islands, the Mongols were always going to have a harder time conquering it than they would have with countries they could invade by land. However, Japan was also helped by two very timely typhoons. Both times the Mongols tried to invade Japan, their fleets were badly damaged by typhoons.
In 1274 and 1281, the Mongols attempted to invade Japan. Ultimately, the invasions were not successful. China at this point in history was governed by the Yuan dynasty- Mongols who had successfully invaded China and taken over as the ruling family. Genghis Khan had successfully invaded China and Korea, so the next logical step in his attempt of territorial expansion was to invade Japan. The only difference is that Japan was not politically and socially arranged like China and Korea.
Japan in this time period was feudal. The ruling family, the Yamamoto Clan, had slowly lost the lion's share of power and the real power was in the hands of powerful, aristocratic families. This decentralized power in the hands of powerful warlords, who carved up Japan and ruled in a feudal system much like that of Europe (one of the key differences is that while Europeans had lords and knights with separate jobs, the daimyo in Japan served the role as both lord and warrior - the samurai). So while the emperor seemed weak to the highly successful and on-a-role Kublai Khan, he decided to invade Japan.
Khan sent an armada of ships across to Japan, but ultimately was unable to conquer the strong ruling families, samurai, and a few disastrous typhoons which knocked out a large amount of Mongol ships. Due to samurai strength, strong feudal systems, environmental factors, and just sheer bad luck, the Mongols were unable to conquer Japan.
The Mongols failed to conquer Japan because each time they boarded boats and were about to cross the sea to go into Japan they came under attack by Kamikazes which were strong winds which made reaching Japan impossible. The Japanese prayed to thier ancestors to protect them from the Mongols. Knowing and fearing that the Mongols were coming to conquer Japan soon. Ironicly, the Kamikazes came each time the Japanese prayed for safety from the Mongols. And each time the Mongols tried crossing the sea they were attacked by the Kamikazes. As a result, they eventully gave up on conquering Japan.