As others have posted, the company gains capital in return for its new shares.
However, the share price can still fall.
The problem is that the share marked is affected by supply and demand like any other marked. If the company just issues the new shares at marked price, they will have problems finding buyers. The people who are willing to pay that price has already bought as many shares as they want.
The company does this to raise capital, and depends on the shares actually selling for this to work. So, they issue shares at below marked price to attract buyers and the shares get diluted. In the end the share will usually end up somewhere between the old marked price and the issue price.
The old share owners are probably not too happy about this and will not accept this plan. (At least here in Norway, share issue has to be accepted at a shareholder meeting)
So, what is often done instead is to issue buy options for the required number of shares at the below-marked price. These options are given (for free) to the current share holders proportional to their current holding.
If everybody exercises their options they get new cheap shares that compensates for the loss of share value. If they don't have the capital themselves, they can sell the options and get compensation that way instead.