Repairing is not free. The more durability points that must be restored, the more expensive the repair is. [[ Ethereal]] items cannot be repaired by NPCs. Some items repair themselves over time.
In Diablo II, repairing is the means by which typically costly spell charges are restored to equipment.
A Ral and an armor piece combined in the Horadric Cube will result in the armor being repaired. Orts can be similarly used to repair weapons. As the repair cost of very high level armor can be many thousands of gold, it can actually be easier to trade for a Ral than collect that much gold.