These were the stats of both armies, via wiki,
British
4,200 British[2]
1,000 Africans
Two Gatling Guns
10 cannons
Zulu
10000-15000 men
The results of the battle were such that the British suffered ~100 causalities and the Zulu ~1500.
This still leaves the Zulus outnumbering the British possibly 2:1. Did they just give up in the face of superior British firepower (i.e gatling gun, nine pounders, etc)?
It's important to know that battles are not determined by how many casualties each side takes. Without getting into a lengthy discussion about strategy, in general, the goal is to make the other side withdraw. Whether this be a rout (enemy cohesion breaks, disorderly retreat, time when most casualties occur) or an organized withdrawal doesn't matter in terms of who "won" the battle, though it may have very large strategic implications.
The British commander, Lord Chelmsford was being replaced. The British suffered a humiliating defeat at the Battle of Islandlwana under his command. However, he had some time before his replacement would arrive. Chelmsford used this opportunity to provoke the Zulu forces into attacking in order to claim victory and repair his tarnished reputation.
To his credit, Chelmsford learned from the lessons of Islandlwana. There, the British were taken by surprise and used standard battle tactics. As seen here, the British forces had formed a standard battle line with their flank protected, but the maneuvering of the Zulu forces, and their superior numbers, allowed them to outflank and encircle the British forces.
Chelmsford would not let that happen again. For the Battle of Ulundi, he formed a square because he knew the Zulu were aggressive and would try to encircle the British forces. As the Zulu had some firearms, and were able to pick off British soldiers, but not enough to abandon their traditional hand-to-hand fighting. But the British were prepared. The cavalry provoked the Zulu into charging, and the square was 4 ranks deep. The Zulu tried many times to rush the square, but were beaten back by massed rifle, Gatling gun, and artillery fire.
This goes to my earlier point - they may have only lost a "small part" of their force, but the withering fire broke their morale. The British cavalry charged and rode down the fleeing Zulu warriors.
Furthermore, the Zulus had the British completely surrounded.