The past three and a half months have been full of drama on a daily basis for Apple (AAPL -0.57%). Swings anywhere from down 4% to up 7% on no particularly relevant news were par for the course during the final quarter of 2012.

Well, the Mac maker is ending the year with a bang as it rallied over $23, or nearly 5%, on the final trading day of 2012.

AAPL Chart

AAPL data by YCharts

Looking back on the past 12 months, Apple has still handily beat the market, even with the gut-wrenching 25% pullback that investors have had to endure. Shares closed out the year with a 29.5% return.

At the peak, Apple was outpacing the Nasdaq Composite (of which it's by far the largest component) by an incredible 50% and absolutely crushing the S&P 500 and Dow Jones Industrial Average.

AAPL Chart

AAPL data by YCharts

What's driving some of Apple's gains as 2012 winds to a close?

Barron's bull
Over the weekend, Barron's ran an article on Apple's cheap valuation. One of the possible culprits behind Apple's three-month sell-off is the prospect of increased capital gains taxes associated with the fiscal cliff that the country is potentially heading over in a matter of hours. With shares up 70% year to date at the peak in September, it's very likely that investors, individual and institutional alike, were looking to lock in some of those healthy gains at lower rates.

Some have dubbed this the "reverse January Effect," despite the fact that it's difficult to prove or disprove it. If selling in anticipation of a higher tax rate is having a meaningful impact on Apple shares, it won't be a long-lived catalyst, and with it out of the way, Apple's prospects may brighten once more.

Barron's articles have been known to move the market in the past. For example, the publication boldly proclaimed that Facebook (META 1.54%) was worth just $15 in September, which sparked a sell-off for the social network the following day. That pessimism was despite the fact that the valuation seemed a bit unscientific at best.

Balancing act
Another reason why things may only get better from here for Apple shareholders is that the iPhone 5 shortages are now a thing of the past. As the latest and greatest device in Apple's most important product family, iPhone 5 supply constraints were the most legitimate concerns facing the company and were very real after the device launched.

The production hurdles stemmed from manufacturing yields on the in-cell touch displays that Apple is using to make the device so thin. Apple "only" sold 5 million units on launch weekend, which disappointed investors, and quoted shipping times on new orders were between three to four weeks for quite a while.

On the last conference call, Tim Cook refrained from saying  whether or not he felt that iPhone 5 supply and demand would balance during the quarter, but it would appear that is now the case as Apple's Online Store now shows all configurations in stock.

Source: Apple.

A number of Wall Street analysts have also offered thoughts on the matter, with the consensus being that the iPhone 5 is catching up with demand.

Apple's land of opportunity
Earlier this month, Apple also launched the iPhone 5 in China with its two official carrier partners, China Unicom (CHU) and China Telecom (CHA), garnering 2 million units on launch weekend. That was the first time Apple had disclosed unit sales figures in China, so it was clearly proud of how many iPhones it moved.

The iPad mini is also off to a strong start in China. Just last week, Topeka Capital Markets analyst Brian White called demand for the device "insatiable." The smaller tablet launched in Hong Kong on Nov. 2 along with the rest of the world, but mainland China didn't get its hands on the device until Dec. 7.

Apple includes both Hong Kong and mainland China in its Greater China geographical segment, where revenues jumped 79% to $23.8 billion in sales last fiscal year. Due to their proximity, some mainland demand is inevitably filled from Hong Kong as iDevice smuggling is a profitable and popular endeavor.

Source: Earnings conference calls.

Apple's sales in Greater China have grown from approximately $858 million in fiscal 2009 to an incredible $23.8 billion in fiscal 2012, representing a compound annual growth rate of 129% over the past four years.

With Apple's partnership with China Mobile (CHL) expected to materialize in 2013, there's plenty of reasons to be bullish heading into the New Year.