In an IPO (initial public offering) or APO (additional public offering) situation, a small group of stakeholders (as few as one) basically decide to offer an additional number of "shares" of equity in the company. Usually, these "shares" are all equal; if you own one share you own a percentage of the company equal to that of anyone else who owns one share. The sum total of all shares, theoretically, equals the entire value of the company, and so with N shares in existence, one share is equivalent to 1/Nth the company, and entitles you to 1/Nth of the profits of the company, and more importantly to some, gives you a vote in company matters which carries a weight of 1/Nth of the entire shareholder body.
Now, not all of these shares are public. Most companies have the majority (51%+) of shares owned by a small number of "controlling interests". These entities, usually founding owners or their families, may be prohibited by agreement from selling their shares on the open market (other controlling interests have right of first refusal). For "private" companies, ALL the shares are divided this way. For "public" companies, the remainder is available on the open market, and those shares can be bought and sold without involvement by the company. Buyers can't buy more shares than are available on the entire market.
Now, when a company wants to make more money, a high share price at the time of the issue is always good, for two reasons. First, the company only makes money on the initial sale of a share of stock; once it's in a third party's hands, any profit from further sale of the stock goes to the seller, not the company. So, it does little good to the company for its share price to soar a month after its issue; the company's already made its money from selling the stock. If the company knew that its shares would be in higher demand in a month, it should have waited, because it could have raised the same amount of money by selling fewer shares. Second, the price of a stock is based on its demand in the market, and a key component of that is scarcity; the fewer shares of a company that are available, the more they'll cost. When a company issues more stock, there's more shares available, so people can get all they want and the demand drops, taking the share price with it. When there's more shares, each share (being a smaller percentage of the company) earns less in dividends as well, which figures into several key metrics for determining whether to buy or sell stock, like earnings per share and price/earnings ratio.
Now, you also asked about "dilution". That's pretty straightforward. By adding more shares of stock to the overall pool, you increase that denominator; each share becomes a smaller percentage of the company. The "privately-held" stocks are reduced in the same way. The problem with simply adding stocks to the open market, getting their initial purchase price, is that a larger overall percentage of the company is now on the open market, meaning the "controlling interests" have less control of their company. If at any time the majority of shares are not owned by the controlling interests, then even if they all agree to vote a certain way (for instance, whether or not to merge assets with another company) another entity could buy all the public shares (or convince all existing public shareholders of their point of view) and overrule them.
There are various ways to avoid this. The most common is to issue multiple types of stock. Typically, "common" stock carries equal voting rights and equal shares of profits. "Preferred stock" typically trades a higher share of earnings for no voting rights. A company may therefore keep all the "common" stock in private hands and offer only preferred stock on the market. There are other ways to "class" stocks, most of which have a similar tradeoff between earnings percentage and voting percentage (typically by balancing these two you normalize the price of stocks; if one stock had better dividends and more voting weight than another, the other stock would be near-worthless), but companies may create and issue "superstock" to controlling interests to guarantee both profits and control. You'll never see a "superstock" on the open market; where they exist, they are very closely held. But, if a company issues "superstock", the market will see that and the price of their publicly-available "common stock" will depreciate sharply.
Another common way to increase market cap without diluting shares is simply to create more shares than you issue publicly; the remainder goes to the current controlling interests. When Facebook solicited outside investment (before it went public), that's basically what happened; the original founders were issued additional shares to maintain controlling interests (though not as significant), balancing the issue of new shares to the investors. The "ideal" form of this is a "stock split"; the company simply multiplies the number of shares it has outstanding by X, and issues X-1 additional shares to each current holder of one share. This effectively divides the price of one share by X, lowering the barrier to purchase a share and thus hopefully driving up demand for the shares overall by making it easier for the average Joe Investor to get their foot in the door. However, issuing shares to controlling interests increases the total number of shares available, decreasing the market value of public shares that much more and reducing the amount of money the company can make from the stock offering.