As gold flirts with its all-time highs, many investors wonder whether it can surge higher or whether gold is just in the middle of a price bubble.

Admittedly, we don't have a crystal ball on that question, but we do know some basic facts that help to explain just how far from its baseline value the yellow metal has come.

Gold's Supply/Demand Profile

According to the World Gold Council, 3.3 billion pounds of gold has been mined from the earth over the course of human history.

[InvestingAnswers Feature: 50 Surprising Facts You Never Knew About Gold.]

Since gold does not oxidize, evaporate or dissolve, much of that gold still exists. How much is anyone's guess, but we can assume that the vast majority of gold mined in the 20th century has been preserved, whether in depositories like Fort Knox or in private safe-deposit boxes. Gold that goes into industrial applications is often salvaged. In some instances, an industrial piece of equipment with gold in it now sits in the junkyard (and bodies with gold teeth lie six feet under). Even in those cases, the gold is retrievable.

So with most of the mined gold still in existence, and more gold being taken out of the ground every year, there doesn't appear to be a shortage of supply. For as long as they can sell it for more than it costs to mine or recover it, gold suppliers will do all they can to meet demand.

Global gold demand comes from four main sources:

1. Industrial processes
2. Jewelry
3. Investors hedging against inflation
4. Governments looking to fund budget deficits or provide confidence in their currencies

It's hard to get a true read of how much gold is bought and sold between countries. Some countries have sold off major gold reserves, while others have loaded up on it. Most analysts assume that major governments do not impact gold prices, and the amount of gold sold by governments roughly equals the amount purchased.

In terms of the other three factors affecting global demand, 50% of gold mined annually is used for jewelry, 40% is used as investments/hedges by individuals and financial institutions, and the remaining 10% is used in dentistry, medicine and electronic devices like conductors and industrial connectors.

Substitution Effect
But like anything else, as prices go up, suppliers use ever-more expensive methods to deliver gold at higher prices, while at the same time end users start looking for cheaper substitutes. Both can have a chilling effect on prices.

As prices rise, gold becomes less attractive to central banks, jewelry buyers and industrial users, some of which substitute other metals with properties similar to gold. Using jewelry as an example, rising gold prices means existing jewelry is turned in and melted down, providing ample supply to the manufacturers of new gold jewelry. But those jewelers must then turn around and find buyers at even higher prices. Eventually, buyers dry up and the gold price finds its top. Buyers will substitute silver jewelry for gold, and there's evidence this is already happening.

The Inflation Argument

So that 40% factor -- as an inflation hedge -- is now an ever more important part of the demand equation. And it's certainly the factor that has caused gold prices to increase in recent years.

Why has gold become so popular among some investors? Because they fear that current government policies are awfully risky. They note that there are two ways a government with massive budget deficits can meet future obligations: 1) By defaulting on their bonds or 2) by subtly encouraging inflation so assets can rise in value while debts stay constant. Either way, gold would become more valuable.

Their fears have a degree of logic. Germany in the 1920s and Zimbabwe in the last decade showed that a sharply-expanded money supply and crushing foreign debts can lead to runaway inflation.

On the other hand, as gold has risen in value, demand for non-investment purposes has begun to fall. Rising gold prices have also stimulated supply.

The recent increase in gold prices has led many gold mining firms to re-open mines that were no longer cost-effective when gold was at $500 or even $1,000 an ounce. As those re-opened mines crank up, the output of gold will follow suit. Rising supply that lacks a commensurate rise in demand sets the stage for falling prices.

Can gold climb yet higher? Sure. Nasdaq stocks were sharply overvalued in the summer of 1999, yet they rose much higher at the end of that year in what's known as a 'melt-up.' But that Nasdaq melt-up set the stage for an ugly meltdown when the music finally stopped.

Even if the inflation hawks are correct and inflation re-emerges, it's unlikely to be the sky-high inflation like we saw in the 1970s. In the context of a reasonable rise in inflation, gold bugs are bound to be disappointed. Investors are playing a game of musical chairs, pushing gold higher and higher -- but the music always stops.