Companies "go public" via initial public offerings (IPOs) -- issuing shares of stock to be traded in public stock markets like 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, 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 -- such as Goldman Sachs (NYSE:GS) or Morgan Stanley (NYSE:MWD) -- which underwrites stock and bond offerings. 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, 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 one another 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 (SEC). 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. And you can follow discussions of companies going public on our Initial Public Offerings discussion board.

Learn more about how the financial world works in our Investing Basics area and in 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.

Longtime Fool contributor Selena Maranjian doesn't own shares of any companies mentioned in this article.