For example, lets say Company XYZ anticipates making $100M in gross profits but decides to invest $100M in R&D for a new product. Their reported gross profit would be $0M for the year due to the $100M charge.
Unlike you or I, if a company makes no profits, it pays no tax on its income.
The basic reason is because income is seen as distinct from profit. If personal income taxes were based on a profit-like model, you would require everyone in a country to keep double-entry books on every transaction they made. That is unlikely to be a very popular policy.
I am not an accountant, this is not financial advice.
But yes, businesses are treated somewhat differently (but mostly it's businesses, not corporations; an individual with business income and expenses can do the same as a corporation, at least to offset business income -- I forget whether business losses that exceed business income apply against other income, though ISTR they do and that's a key difference between hobby expenses (which can only offset hobby income) and business expenses.
No, in addition to regular business expenses being deductible, there's all kinds of special deductions and credits for specific kinds of reinvestment.
If you spend the money on operational expenses (OpEx), then you reduce your profit by that amount and thus your taxes.
If you spend the money on capital expenses (CapEx), you create assets that will depreciate in future. The depreciation can be deducted from your profit and also reduce your taxes in forward periods.
Thus a company can arrange its affairs to have very high free cash flow but low profits. And sometimes vice versa, which usually leads to unhappy surprises for careless investors.