Wall-crossing formulas in algebra, geometry and physics