Companies "go public" via initial public offerings (IPOs) -- issuing shares of stock to be traded in public stock markets such as the New York Stock Exchange or Nasdaq.

Consider PieMart Inc. (ticker: GOBBL), maker of tasty cantaloupe pies. Stores can't keep these pies in stock. To meet demand, it needs to make a heck of a lot more pies. It should hire more workers and build more factories, but poor PieMart doesn't have much cash. Oops.

The company isn't doomed, though. It can borrow from a bank. Or it can issue bonds (borrowing money from individuals or institutions and promising to pay the lenders back with interest). It can find some wealthy person or company interested in investing in PieMart. Or it can go public, by issuing shares of stock. Start-ups often use many or all of these options. They frequently secure venture capital funding, for example, a few years before going public. And until they attract venture capital dollars, they may rely on bank loans.

To go public, PieMart will need to hire an investment-banking firm, which underwrites stock and bond offerings. Examples include Goldman Sachs (NYSE:GS) and Morgan Stanley (NYSE:MWD). The bankers will study PieMart's business, and if they think the company is worth around $150 million, they might recommend that PieMart sell 10% of its business as stock, which would mean issuing 1 million shares priced at $15 per share. Once it is announced that PieMart is going public, if it seems that people will be scrambling to buy shares, the bank might raise the opening price. A lack of interest might cause the price to be lowered, or PieMart might even decide to postpone the offering.

If all goes as planned, $15 million will be generated. The investment bank will keep roughly 7% for its services (yowza -- that's more than $1 million!), and PieMart will get the rest. From now on, people will buy and sell PieMart shares from each other on the open market, and PieMart will not receive any more proceeds from these shares. The company got its money when it issued them.

If PieMart later decides to raise more money by offering additional shares of stock to the public, that will be a "secondary offering."

Public companies such as PieMart have obligations to shareholders and the Securities and Exchange Commission. For example, they have to announce earnings four times a year. Remember that they're partially owned by the public, by shareholders like you. When they spend their new money to grow the business, they're spending your money. That's why you have a right to know what they've been up to.

For more info, read "The ABCs of IPOs" and our IPO FAQ.

You can learn more about how the financial world works by visiting our Investing Basics area and our Fool's School. If you're interested in receiving a handful of promising stock ideas each month, consider subscribing to one of our Fool investment newsletters. (They offer money-back guarantees, so you've got little to lose.) Or check out some of our inexpensive and well-regarded online how-to guides, which come with money-back guarantees.

You can also learn all about brokerages and find one that's right for you by going to our Broker Center. (Did you know that some well-regarded brokerages are offering commissions as low as $5?)