The Japanese plan failed, partly because Nishimura's force was virtually destroyed by U.S. battleships and cruisers. For the first time, kamikaze pilots, suicidally crashing their aircraft onto their targets, sank a U.S. ship. The outcome of the battle seemed to be in doubt when, to surprise and relief of the Americans, Kurita withdrew.
Choosing to engage the enemy in the battle of Leyte Gulf, the largest naval battle in world history, was a necessary gamble for the Japanese. Without the Philippines, they would be cut off from their fuel supplies in the Netherlands East Indies (now Indonesia). The gamble failed. The Japanese lost most of the major naval ships that they possessed and ten thousand Japanese lost their lives, as did 1,500 U.S. servicemen.
General Tomoyuki Yamashita, Japanese commander in hte Philippines, did not plan to fight in Manila. He left about 20,000 troops in the city, in charge of Rear Admiral Iwabuchi, and withdrew northwards to harass the enemy. He even planned to grow his own crops in northern Luzon to feed his troops (Sheehan p. 37-38)