The company issues shares, but it is a separate entity from its stockholders. The money acquired by selling the shares goes to the company, not the existing stockholders. It results in the company being more valuable, and the existing stockholders (or the board of directors on their behalf) can think this is a worthwhile thing to do if they think the money will be invested well by the company.