When searching for a new CEO, boards must make the consequential decision whether to hand the keys to a rising internal star or go outside the company to recruit an outsider with a gaudy resume.

There are countless factors that may determine the ultimate success or failure of this crucial decision. Yet internal CEOs seem to hold the edge over external leaders thanks to their wealth of institutional knowledge, ability to instill confidence in the organization and tougher vetting process.

According to a Booz & Company study released recently, companies with an insider CEO outperformed their respective stock market by 4.4% between 2009 and 2011, compared with just 0.5% for companies with an outsider CEO.

“Sadly and predictably, most externally recruited, 'star’ CEOs fail to live up to their initial hype,” Jeffrey Cohn, author of Why We Are Bad at Picking Good Leaders, wrote in an email. “I always recommend they look within their own ranks before engaging a search firm with a gold-plated rolodex to recruit their next ‘corporate savior.’”

Not only do internal CEOs have a history of generating better shareholder returns, they’re also likely to stick around longer.

Over the past 12 years, outgoing insider CEOs served their companies for an average of 7.6 years, compared with just 5.6 years for outgoing outsider CEOs, according to Booz’s 2011 CEO Succession study.

In-house chiefs are also less likely to get canned. The report said that over the past three years, 19% of non-M&A related turnover events for insider CEOs were forced departures, compared with 35% for outside leaders.

Insiders Seen as Less Risky

It’s clear that internal CEO candidates have some inherent advantages over their outside peers. For starters, in-house executives have a better grasp over the company’s culture and they tend to understand what works and what doesn’t.

Insider CEOs also often benefit from support from key executives and stakeholders, including sometimes the outgoing CEO. This backing gives the new chiefs the freedom to carry out their vision.

At the same time, corporate morale can receive a boost from the board selecting the new CEO from the company’s own stable of talent, lowering the chances of rank-and-file employees bolting and lessening management turnover.

“It’s incredibly disruptive to have the head of the organization come in from the outside,” said Sandra Davis, CEO of MDA Leadership Consulting. “If the board thinks this is a great team in place, the less they can disrupt that, the better.”

For example, Apple (AAPL) has continued its torrid growth pace under CEO Tim Cook, who served as the right-hand man to Steve Jobs for years before seamlessly ascending to the top job upon Jobs’s death last year.

Tougher Vetting Process

Boards also tend to put internal CEO candidates under a greater microscope than well-known outsiders who may have more impressive resumes. This tougher selection process can help weed out people who may end up being a poor fit for the organization.

“I think at times boards fall in love with an outsider,” said Davis.

Last month, Yahoo (YHOO) was dealt a huge blow when Scott Thompson was forced out after just four months as CEO. Thompson, who was recruited from eBay’s (EBAY) PayPal, was discovered to have padded his resume.

“Inside candidates have had much more and much longer exposure to the board, which is why they should always be given first consideration before looking beyond corporate walls,” said Cohn.

Outsiders Can ‘Shake Things Up’

To be sure, it’s not fair to say boards should always hire an internal candidate over an external one. Success or failure may hinge on industry dynamics, the age of the company and other factors.

“I think companies would be better advised to link CEO succession to their strategy and needs rather than always go by the rule of thumb inside over outside,” said Ralph Walkling, executive director of Drexel University’s Center for Corporate Governance.

External CEOs can be particularly successful at shaking things up at a struggling company, thanks largely to their outside perspective and lack of ties to the organization.

“They’re not wedded to prior constraints and personal relations,” said Walkling. “Disruption can be good or bad.”

A reeling IBM (IBM) experienced this firsthand after selecting outsider Louis Gerstner to lead its turnaround in 1993. The former RJR Nabisco CEO has been credited with successfully rejuvenating the tech giant, which today is worth around $223 billion.

Onus on Boards to Plan Succession

Other times outsiders can be hired due to their experience working in other geographical regions as the company looks to expand its operations or focus.

Likewise, boards shouldn’t hire from within when the talent pool is found to be lacking.

Still, because hiring an outside savior is seen as a riskier strategy, boards should always be planning for CEO succession by developing internal talent.

“It’s one of those 'brush your teeth after every meal' things: They all know they need to do it but most of them don’t,” said Ralph Ward, publisher of The Boardroom Insider.

Follow Matt Egan on Twitter @MattMEgan5