@edwinyzh as I understand it, basically you deduct the debt from the profit and pay taxes only for the remaining amount. Wikipedia has a very short article on this [1].
Debt itself (as a liability) is definitely not deducted from profit, but repayment of debt is deducted from the profit, and - what is more important - interest on debt is deducted from the tax base as a result. Which means that if you can load up on debt to get higher return, than you would get investing your own money.