Deductions & credits

So is the only part of the property investment that is deductible the interest?  Why is it that house flippers avoid paying large amounts of taxes by reinvesting the earnings from the sale of 1 house into the purchase of the next?