No one in the airline industry comes close to Virgin America Inc. on a measurement of efficiency called revenue per employee. That’s because baggage delivery, heavy maintenance, reservations, catering and many other jobs aren’t done by employees. Virgin America uses contractors.

“We will outsource every job that we can that is not customer-facing,” David Cush , the airline’s chief executive, told investors last March. In April, he helped sell Virgin America to Alaska Air Group Inc. for $2.6 billion, more than double its value in late 2014. He left when the takeover was completed in December.

Never before have American companies tried so hard to employ so few people. The outsourcing wave that moved apparel-making jobs to China and call-center operations to India is now just as likely to happen inside companies across the U.S. and in almost every industry.

The men and women who unload shipping containers at Wal-Mart Stores Inc. warehouses are provided by trucking company Schneider National Inc.’s logistics operation, which in turn subcontracts with temporary-staffing agencies. Pfizer Inc. used contractors to perform the majority of its clinical drug trials last year.

The contractor model is so prevalent that Google parent Alphabet Inc., ranked by Fortune magazine as the best place to work for seven of the past 10 years, has roughly equal numbers of outsourced workers and full-time employees, according to people familiar with the matter.

About 70,000 TVCs—an abbreviation for temps, vendors and contractors—test drive Google’s self-driving cars, review legal documents, make products easier and better to use, manage marketing and data projects, and do many other jobs. They wear red badges at work, while regular Alphabet employees wear white ones.

The shift is radically altering what it means to be a company and a worker. More flexibility for companies to shrink the size of their employee base, pay and benefits means less job security for workers. Rising from the mailroom to a corner office is harder now that outsourced jobs are no longer part of the workforce from which star performers are promoted.

For companies, the biggest allure of replacing employees with contract workers is more control over costs. Contractors help businesses keep their full-time, in-house staffing lean and flexible enough to adapt to new ideas or changes in demand.

For workers, the changes often lead to lower pay and make it surprisingly hard to answer the simple question “Where do you work?” Some economists say the parallel workforce created by the rise of contracting is helping to fuel income inequality between people who do the same jobs.

No one knows how many Americans work as contractors, because they don’t fit neatly into the job categories tracked by government agencies. Rough estimates by economists range from 3% to 14% of the nation’s workforce, or as many as 20 million people.

One of the narrowest definitions of outsourcing, workers hired through a contracting company to provide on-site labor for a single client, rose to 2% of all U.S. workers in 2015 from 0.6% in 2005, according to an academic study last year.

(Go here for more about the complications in counting contractors.)

Companies, which disclose few details about their outside workers, are rapidly increasing the numbers and types of jobs seen as ripe for contracting. At large firms, 20% to 50% of the total workforce often is outsourced, according to staffing executives. Bank of America Corp. , Verizon Communications Inc., Procter & Gamble Co. and FedEx Corp. have thousands of contractors each.

In oil, gas and pharmaceuticals, outside workers sometimes outnumber employees by at least 2 to 1, says Arun Srinivasan , head of strategy and customer operations at SAP Fieldglass, a division of business software provider SAP SE that helps customers manage their workforces.

Janitorial work and cafeteria services disappeared from most company payrolls long ago. A similar shift is under way for higher-paying, white-collar jobs such as research scientist, recruiter, operations manager and loan underwriter.

According to data from the Bureau of Labor Statistics, 25% of all medical transcriptionists, who type medical reports recorded by doctors and nurses, were employed in what the agency calls the business support services industry in 2015. The percentage has jumped by more than a third since 2009, a sign that transcriptionists are being pushed out of many doctors’ offices and hospitals.

“I haven’t yet met a CEO who’s not surprised by how many people who touch their products aren’t their own employees,” says Carl Camden , president and CEO of staffing agency Kelly Services Inc. Outsourcing and consulting brought in 14% of Kelly’s revenue in 2016.

Eventually, some large companies could be pruned of all but the most essential employees. Consulting firm Accenture PLC predicted last year that one of the 2,000 largest companies in the world will have “no full-time employees outside of the C-suite” within 10 years.

Accenture is one of the world’s largest providers of outsourced labor. Along with many rivals, it is pitching chief executives on the idea that their company’s core business is smaller than they think.

“We’ve shown we can do core parts of their business better than they can do it themselves,” says Mike Salvino , who ran Accenture’s outsourcing business for seven years until he left in 2016.

Steven Barker , 36 years old, says companies often dangle the possibility of full-time employment but seldom follow through. He has worked contract assignments at Amazon.com Inc., where it was common during orientation sessions for someone to ask if the job could become permanent.

He says the answer usually was: “We’ll see. Anything’s possible!”

At Amazon, Mr. Barker applied to become a full-time employee on X-Ray, which lets customers access actor biographies and other information while watching movies and television shows. He was an X-Ray contractor since it was in the development stage, he says, but wasn’t offered a job interview and eventually received a generic rejection letter from the company. Amazon declines to comment.

(Tell us about your experiences working as a contractor, and go here to join our Facebook group for contract workers.)

Companies sometimes try outsourcing and then change their minds. About 70% of Target Corp.’s information-technology jobs were outsourced when Mike McNamara became chief information officer at the retailer in 2015. About 70% of those jobs now are done by employees.

“I’m a strong believer that if you can get competitive advantage out of something, you want it in-house,” he says. “That I have better supply-chain algorithms than [my competitors] really matters.”

Few companies, workplace consultants or economists expect the outsourcing trend to reverse. Moving noncore jobs out of a company allows it to devote more time and energy to the things it does best. When an outside firm is in charge of labor, it assumes the day-to-day grind of scheduling, hiring and firing. Workers are quickly replaced if needed, and the company worries only about the final product.

About 200 UPS employees can do the work for five factories that 150 Pratt employees did for two. Pratt’s employees were unionized, but UPS’s aren’t. Photo: Simon Simard for The Wall Street Journal

Steven Berkenfeld , an investment banker who has spent his career evaluating corporate strategies, says companies of all shapes and sizes are increasingly thinking like this: “Can I automate it? If not, can I outsource it? If not, can I give it to an independent contractor or freelancer?”

Hiring an employee is a last resort, Mr. Berkenfeld adds, and “very few jobs make it through that obstacle course.”

Visitors arriving at SAP, based in Walldorf, Germany, likely don’t notice that about 30 receptionists at its U.S. facilities work for contractor Eurest Services, part of Compass Group PLC. It happened in 2014 after SAP executives concluded during a review of potential outsourcing opportunities that some managers were paying their receptionists above-market wages.

SAP handed over hiring, training and oversight of receptionists to an outside firm. They were told they could leave SAP or keep their jobs through Eurest, which pays the receptionists in line with the overall market.

SAP says the move left the company with less to manage. “Internally, when [an employee’s] skills aren’t up to par, there’s a protracted process of managing performance,” says Jewell Parkinson , the human-resources chief for SAP’s North American division. “Working through the vendor, it’s a more efficient turnaround.”

Some economists liken the strategy to Hollywood studios, which greenlight movies and then hire directors, actors, editors, special-effects teams and marketing agencies for production. All those outsiders work together to deliver the movie, but the studio has no long-term obligations after the film’s release.

When jet-engine maker Pratt & Whitney no longer wanted to handle coordinating deliveries to its factories, it hired United Parcel Service Inc., which has thousands of logistics experts and specialized automation technology.

For years, suppliers delivered parts directly to Pratt’s two factories, where materials handlers unpacked the parts and distributed them to production teams. Earl Exum , vice president of global materials and logistics, says Pratt had “a couple hundred” logistics specialists. Some handlers were 20- or 30-year veterans who could “look at a part and know exactly what it is,” he adds.

As Pratt wrestled with plans to speed production of a new jet engine and open three new factories, executives decided in 2015 to centralize delivery and distribution of parts in one facility. That facility would receive all the parts, pack them into assembly kits and send them to the five factories.

UPS custom-built a 600,000-square-foot facility, roughly the size of 10 football fields, for Pratt in Londonderry, N.H. About 150 Pratt employees who handled parts at the two factories were offered a chance at retraining for production jobs. Many did, and the rest left the company or retired. UPS has hired about 200 hourly workers for the facility.

Most of the UPS employees had no experience in the field, and assembly kits arrived at factories with damaged or missing parts. Pratt and UPS bosses struggled to get the companies’ computers in sync, including warehouse-management software outsourced by UPS to another firm, according to Pratt.

The result: a 33% decline in engine deliveries by Pratt, a unit of United Technologies Corp. , or about $500 million in sales, in the third quarter of 2015.

Production was back on schedule by the following quarter, and Pratt’s Mr. Exum says the facility is running well now. The 200 UPS employees can do work for five factories that 150 Pratt employees used to do for two. Pratt’s employees were unionized, but UPS’s aren’t. The union representing Pratt workers objected to the move.

The flexibility of outsourced labor helps Southwest Airlines Co. shield its employee base from the ups and downs of the airline industry. The fourth-largest U.S. carrier by traffic has about 53,000 employees and 10,000 outside workers.

The nonemployees range from wheelchair pushers in airports to information-technology professionals. “We’ve never had a layoff in our history,” says Greg Muccio , Southwest’s head of recruiting. “When we look at contingent workers, we’re protecting that because what we don’t want to do is balloon up and then be in a situation where we need to lay people off.”

Outsourced workers at Google parent Alphabet arrive through staffing agencies such as Zenith Talent, Filter LLC and Switzerland’s Adecco Group AG , which alone bills Alphabet about $300 million a year for contractors and temps who work there, according to an Adecco executive.

Google wouldn’t comment on how it decides which jobs are done by contractors rather than employees. A former contractor in the search division says he got the impression from conversations and meetings that he was a nonemployee because his skill set wasn’t a core feature of the product on which he was working. He says managers also needed the ability to ramp down quickly if the project wasn’t successful.

The contractor eventually became a full-time employee. He says he was told the decision to put him on the regular payroll had to be approved by Google co-founder Larry Page , now Alphabet’s chief executive, at a product-review meeting.