Gold stocks own gold mines. Gold mines require energy resources to dig the stuff out of the ground. If gold price goes up 15%, but diesel goes up 30%, the mine's profit margin has just compressed.
In other words, gold stocks do not necessarily do well when there's rampant energy inflation.
You need to check the _real_ price of gold, not the _nominal_ price of gold, in order to assess whether gold stock will follow the gold price.
In order to get the _real_ price of gold, you need to deflate the nominal price by some inflation index. CPI & PPI are some indices you may use to deflate the nomial price, but they are not perfect due to gov't manipulations of those indices. A better way is to construct yourself a modified CRB index that has the gold component stripped out. Then deflate the price performance of gold against the price movement of the modified CRB index. Then you have good idea whether gold is gaining in real terms. If it is, the gold stock should outperform.
There are also other factors: currency movements, management competence, political risks -- the comes w/ investing in gold stocks.
Remember, when gold stocks are valued based on the _discounted future cash flow_ you may get from the mines -- even if the mine is not paying a dividend now. The time value element (a function of a slew macoeconomic and socialeconomic facotrs, some mentioned above) makes gold stock much different the the pricing of the commodity gold.
Hope this helps.