Image source: First Solar.

It's been an up-and-down year for First Solar (FSLR 3.04%), but the stock has still managed to outperform the S&P 500 as well as almost all of its major solar rivals. How has it done this, and will the magic continue?

To answer that question, let's look at how First Solar has built its dominant position in the solar industry. 

FSLR Chart

FSLR data by YCharts.

Leading the utility-scale solar charge
Residential solar gets a lot of attention from the media and solar investors, but it's actually just a small sliver of the solar power systems installed around the world each year. According to GTM Research, in 2014, the U.S. installed 6.2 GW of solar, and 3.9 GW of that was large utility-scale projects. First Solar was one of the market leaders in that space.

Utility-scale solar has a few advantages that investors should love. Utility-scale projects usually contract electricity sales with utilities before they're ever built, so they're working with the utility infrastructure instead of against it, like residential or commercial solar might do. This makes it less susceptible to policy changes to net metering or utility bills.

The counterparties of these utility-scale projects are also usually very highly rated and aren't going anywhere anytime soon. So, instead of worrying about whether someone is going to sell their house and whether the next homeowner will be a reliable solar customer, utility-scale solar projects have one customer whom the company knows will be reliable over the course of the contract.

Utility-scale solar plants can also be built by local contractors rather than company employees. One of the weaknesses in a residential model like Vivint Solar is that they have thousands of workers and millions in equipment that all needs to stay busy. If demand dries up or moves to a new location, those workers and equipment become costs that are expensive to eliminate. Utility projects simply allow developers more flexibility.

Financing is another big advantage of utility-scale projects. Projects can be sold, pushed down to a vehicle like a yieldco, or even held on the balance sheet. Residential and commercial projects are harder to sell and often stay on a company's balance sheet.

Solar technology matters
First Solar is one of only a small number of solar companies that use something other than commoditized Chinese solar panels. That gives the company a differentiated technology, and recent improvements that increased the efficiency of the company's CdTe solar panels will help it produce more power for less investment.

You can see below that by the end of 2017, First Solar expects to get as much as 18% more power out of each square meter of solar it installs versus commodity competitors.

Image source: First Solar.

This technology advantage and a lower cost structure for utility-scale projects is why First Solar is one of the most profitable companies in the industry.

Making money matters
One thing that often gets lost among the headlines in the solar industry is that companies that make money have a greater chance of long-term survival in disrupting the multitrillion-dollar energy industry. Just look at the net income trends for First Solar versus SolarCity and Yingli Green Energy over the past two years.

FSLR Net Income (TTM) Chart

FSLR Net Income (TTM) data by YCharts.

First Solar has been making this profit despite keeping projects on the balance sheet for the yieldco 8point3 Energy Partners, and while investing in improving technology. As the yieldco begins churning out cash, and the company's efficiency improvements are rolled out to manufacturing, we should see profits sustain, if not improve.

One of the best in solar
First Solar has been one of the most successful solar companies in the past decade, despite the industry's ups and downs. The reason it's endured is the company's competitive advantage in utility-scale projects, improving technology, and ability to turn its position into consistent profits. There aren't many solar companies who are in as strong a position, and with solar energy's future only getting brighter, I think this is a stock for long-term investors to buy and hold for a long time to come.