What contributed to the failed Mongol invasions of Japan?

What contributed to the failed Mongol invasions of Japan?