A few years ago, while I was in business school, I had the chance to work as an intern at a hedge fund that performed high-frequency trading, traded derivatives, and used leverage that would make Lehman Brothers proud. In my few months there, I learned a lot about how the market really works and how different players have a role in the market. Today I will begin chronicling some of the things I learned along the way by covering electronic trading in the real world. In this series of articles, I hope to open a door into some of the market mechanics, trading, and risks that few investors get to see.

High-frequency trading, facts and myths
High-frequency trading has gotten a bad name, particularly after the flash crash last year. But it has actually made markets more efficient and lowered some invisible costs for retail investors as it has grown.

One of the ways high-frequency trading makes markets efficient is by speeding up the arbitrage process for stocks, ETFs, and derivatives like options. Stocks may trade on multiple exchanges, and in a split second, high-frequency traders can take advantage of this gap and bring the market to equilibrium.

High-frequency traders can also make ETFs more efficient by buying and selling ETF shares and underlying assets to keep the ETF near its net asset value. If the gap widens far enough, a trader can build a large position and buy or sell creation units in the ETF.

For instance, use Vanguard's Dividend Appreciation ETF (NYSE: VIG) as an example. Last night, the ETF closed at $54.72, and its net asset value was exactly $54.72. The day before, the gap between the price and NAV was $0.01, but that could be accounted for by the $0.01 bid/ask spread on the market.

The same split-second efficiency can be applied to options, futures contracts, bonds, and most securities trading on an exchange.

But there's a dark side to this market efficiency. Unlike old-school trading by companies such as JPMorgan Chase (NYSE: JPM) and Goldman Sachs (NYSE: GS) on the floor of the New York Stock Exchange, high-frequency traders can easily pull bids, and market liquidity can dry up in an instant. We saw that during the flash crash, when one trader told me before it happened that he felt as if something funny was going on and he pulled all of his bids from the market. Pulling thousands of bids and asks was as easy as the push of a button.

When this happens at one firm, there's no big loss for the market. But when everyone does it, there's sheer panic. No one is there to backstop it.

Exchanges such as Nasdaq OMX (Nasdaq: NDAQ) and NYSE Euronext (NYSE: NYX) have incentives for traders to provide liquidity and maintain a certain amount of trading volume, but not all high-frequency traders have an incentive to keep a bid active at all times. As we saw in the flash crash, when enough bids disappear and sellers flood the market, the results can be extreme.

Making money on high-frequency trading
If I told you that a high-frequency trader made 10,000 trades per day, how much do you think that would cost in brokerage fees? Even with discount brokers, that many trades could cost retail investors as much as $100,000.

But a high-frequency trader can actually make money on each transaction and therefore pay a negative brokerage fee. Nasdaq pays as much as $0.00295 per share to provide liquidity, a nearly $0.30 rebate for a standard 100-share lot. Provide liquidity for millions of shares a day, and the payoff can be substantial.

Land of unintended consequences
Now that we know how electronic trading works and makes money, it sounds like a safe enough concept. But as fellow Fool Alex Planes pointed out, it has also increased volatility for all investors.

Many of the firms providing liquidity are also hedge funds, which are often highly leveraged in their positions. If the market goes the wrong direction, a margin call on a big hedge fund can send stocks tumbling or flying higher in a short squeeze. If a fund uses leveraged investments like futures contracts, the moves can be even worse.

Takeaways from electronic trading
There are trading advantages for market makers and high-frequency traders that most of us can't tap into, but they're concepts we should be aware of. They contribute to profit and risks in financial institutions such as Wells Fargo (NYSE: WFC) and Interactive Brokers (Nasdaq: IBKR) that make markets in stocks, options, and other securities and can see positions change value in the blink of an eye.

Making a dollar or two on each trade may sound like an easy proposition, but remember that there's no such thing as a riskless trade. The big banks found this out the hard way, and many electronic traders have drawn the short end of the stick when the market turned against them.

Check back later this week for some insights into what hedge funds are really trading and how they view risk. It's scarier than you might think.