The Americans (this is all from wikipedia) had around 60,000 Marines engaging in an amphibious landing against 20,000 Japanese soldiers with fortifications. As far as I understand, 20,000 entrenched troops should in theory hold fairly well against 60,000 attackers. How did Japan lose the island?
The US controlled the waters around and the air above the island. This meant that the Japanese were pretty much doomed to lose, because they couldn't resupply or reinforce the island. The naval and air units also added a lot of firepower to the American side of the ledger. The preparatory bombardment was way too short. But during the battle the ability to call down some 16" naval gunfire or a close in aerial bombardment was a massive advantage. So even though they weren't "directly" engaged you have to factor in the tens of thousands of men floating just offshore supporting the attack.
The Americans were also much better equipped. The "zippo" flame-throwing Sherman tanks alone gave the Japanese fits. Most of their artillery couldn't deal with it either because of how it was situated or because it was too small of caliber. Which meant whenever one showed up the local defenders frequently had to abandon their position or take some significant risk to try and eliminate it. But the equipment went all up and down the line. The Americans on the whole, man-for-man, had both better weapons, and more of them. They also had resupply ships bringing in more ammo for those weapons. They also had more and better food, medicine, pretty much everything (except concrete bunkers).
Yet despite these advantages the Americans still took more casualties than they inflicted. In his book Eagle Against the Sun, Ronald Spector points out that between Iwo Jima and Okinawa, US morale fell and Japanese morale rose. If taking those two islands resulted in those kinds of casualties, what would invading Japan proper be like? The US was preparing for a bloodbath that would make the rest of the war (from their perspective) look like a cakewalk. In the end the Atomic bombs and the Soviet invasion combined to convince the Japanese to surrender. But it wouldn't be outrageous to call Iwo Jima a "win" of sorts for the Japanese. The defenders did what was asked, they delayed the Americans and inflicted terrible losses on them. In all they did better than expected.