Or at least, that’s one plausible and completely valid theory. But before you start campaigning for a universal basic income and set up a bunker, you might want to also familiarize yourself with the competing theory: In the long run, we’re going to be just fine.

We’ve been here before

Our modern fear that robots will steal all the jobs fits a classic script. Nearly 500 years ago, Queen Elizabeth I cited the same fear when she denied an English inventor named William Lee a patent for an automated knitting contraption. “I have too much regard for the poor women and unprotected young maidens who obtain their daily bread by knitting to forward an invention which, by depriving them of employment, would reduce them to starvation,” she told Lee, according to one account of the incident. The lack of patent didn’t ultimately stop factories from adopting the machine.

Two hundred years later, Lee’s invention, still being vilified as a jobs killer, was among the machines destroyed by protestors during the Luddite movement in Britain. More than 100 hundred years after that, though computers had replaced knitting machines as the latest threat to jobs, the fear of technology’s impact on employment was the same. A group of high-profile economists warned President Lyndon Johnson of a “cybernation revolution” that would result in massive unemployment. Johnson’s labor secretary had recently commented that new machines had “skills equivalent to a high school diploma” (though then, and now, machines have trouble doing simple things like recognizing objects in photos or packing a box), and the economists were worried that machines would soon take over service industry jobs. Their recommendation: a universal basic income, in which the government pays everyone a low salary to put a floor on poverty.

Today’s version of this scenario isn’t much different. This time, we’re warned of the “Rise of Robots” and the “End of Work.” Thought leaders such as Elon Musk have once again turned to a universal basic income as a possible response.

But widespread unemployment due to technology has never materialized before. Why, argue the optimists, should this time be any different?

Automating a job can result in more of those jobs

Though Queen Elizabeth I had feared for jobs when she denied Lee’s patent, weaving technology ended up creating more jobs for weavers. By the end of the 19th century, there were four times as many factory weavers as there had been in 1830, according James Bessen, the author of Learning by Doing: The Real Connection between Innovation, Wages, and Wealth.

Each human could make more than 20 times the amount of cloth that she could have 100 years earlier. So how could more textile workers be needed?

According to the optimist’s viewpoint, a factory that saves money on labor through automation will either:

Lower prices, which makes its products more appealing and creates an increased demand that may lead to the need for more workers.

Generate more profit or pay higher wages. That may lead to increased investment or increased consumption, which can also lead to more production, and thus, more employment.

Amazon offers a more modern example of this phenomena. The company has over the last three years increased the number of robots working in its warehouses from 1,400 to 45,000. Over the same period, the rate at which it hires workers hasn’t changed.

The optimist’s take on this trend is that robots help Amazon keep prices low, which means people buy more stuff, which means the company needs more people to man its warehouses even though it needs fewer human hours of labor per package. Bruce Welty, the founder of a fulfillment company that ships more than $1 billion of ecommerce orders each year and another company called Locus Robotics that sells warehouse robots, says he thinks the threat to jobs from the latter is overblown—especially as the rise of ecommerce creates more demand for warehouse workers. His fulfillment company has 200 job openings at its warehouse.

How automation impacts wages is a separate question. Warehouse jobs, for instance, have a reputation as grueling and low-paying. Will automation make them better or worse? In the case of the loom workers, wages went up when parts of their jobs became automated. According to Bessen, by the end of the 19th century, weavers at the famous Lowell factory earned more than twice what they earned per hour in 1830. That’s because a labor market had built up around the new skill (working the machines) and employers competed for skilled labor.

That, of course, is not the only option, but it is an outcome embraced by the optimist crowd. Similarly positive results of automation: If companies can make more money with the same number of workers, they can theoretically pay those workers better. If the price of goods drops, those workers can buy more without a raise.

As automation kills some jobs, it creates others

As the Industrial Revolution ended, about half of American workers were still employed in agriculture jobs, and almost all of those jobs were about to be lost to machines.

If nothing else had changed, the decrease in agriculture jobs could have led to a largely unemployed society. But that’s not what happened. Instead, as agricultural employment dwindled, jobs in other sectors grew during the same period. They involved working in factories, yes, but also working with computers, flying airplanes, and driving cargo across the country—occupations that weren’t feasible in 1900.

Today’s optimists believe that the latest automation technologies will create new jobs as well.

What kind of jobs, they really can’t say (this is where the optimism comes in handy). About a third of new jobs created in the United States over the past 25 years didn’t exist (or just barely existed) at the beginning of that period, and predicting what jobs might be created in the next 25 years is just guessing. In a report on artificial intelligence and the economy, the Obama White House suggested that automation might create jobs in supervising AI, repairing and maintaining new systems, and in reshaping infrastructure for developments like self-driving cars. But, the report’s authors note, “Predicting future job growth is extremely difficult, as it depends on technologies that do not exist today.”

Automation doesn’t necessarily make humans obsolete

In 2013, researchers at Oxford sparked fear of the robot revolution when they estimated that almost half of US occupations were likely to be automated. But three years later, McKinsey arrived at a very different number. After analyzing 830 occupations, it concluded that just 5% of them could be completely automated.

The two studies obviously counted differently. The Oxford researchers assessed the probability that occupations would be fully automated within a decade or two. But automation is more likely to replace part of a job than an entire job. When Amazon installs warehouse robots, they currently don’t replace full workers, but rather, the part of the job that involves fetching products from different shelves. Similarly, when my colleague used artificial intelligence to transcribe an interview, we didn’t fire him; he just worked on the other parts of his job. McKinsey’s researchers’ model didn’t attempt to sort jobs into “replaceable” and “not replaceable,” but rather to place them on a spectrum of automation potential.

Almost every occupation that McKinsey looked at had some aspect that could be automated. Even 25% of tasks inside of a CEO job, the analysis found, could be automated. But very few jobs could be entirely automated.

McKinsey’s conclusion was not that machines will take all of these jobs, but rather, “more occupations will change than will be automated away.” Our CEO, for example, won’t spend time analyzing reports if artificial intelligence can draw conclusions more efficiently, so he can spend more time coaching his team.

This part of the optimist’s theory argues that if humans aren’t bogged down by routine tasks, they will find something better to do. The weavers will learn the new job of operating the machines. My coworker will write more articles because he’s not transcribing interviews. The warehouse workers will each pack more boxes because they’re not running between shelves collecting each item to be packed.

“Any time in history we’ve seen automation occur, people don’t all of the sudden stop being creative and wanting to do interesting new things,” says Aaron Levie, the CEO of enterprise software company Box and an automation optimist. “We just don’t do a lot of the redundant, obsolete work.” He points to potential examples like automatically scheduled calendar appointments or automated research services. “Why won’t we make up that time with doing the next set of activities that we would have been doing?” he says. “What I think it does is make the world move faster.”

What might that look like? Sodexo’s CEO of corporate services, Sylvia Metayer, offers one example. She says the outsourcing company’s building maintenance crew has started using drones to survey roofs for maintenance needs in three locations. Before the drones arrived, a human climbed onto the roof to check things out. Now, that human stays on the ground, which is safer. “The service hasn’t changed, the clients still need someone to help maintain the roof,” she says. “If we do it with drones, the people who would have been going up on the roof have more value, talking with clients about what needs to be done.”

Examples also exist in back office automation. “From what we’ve actually seen on the ground, in real business operations, we’ve seen almost zero job loss,” says Alastair Bathgate, CEO of Blue Prism, a software company that helps automate tasks within customer service, accounting, and other jobs. One of his clients, a bank, trained the automation software to react when a customer overdrew an account by checking to see if there were a balance in another account that could be transferred to cover it. This was a process that had never been done by humans, because it would be too tedious and expensive. Another bank used the software to allow customer service representatives to direct customers who had a credit card stolen to an automated system that would input their information and close the account. What do they do now? “It allows them to take another call,” Bathgate says. On-hold time, not head count, went down.

We may need automation

As the birthrate in many countries declines, the share of the working age population will shrink. To maintain today’s GDP, those workers will each need to be more productive than workers today, and they’ll need to improve at a faster rate than they have in the past. Even if productivity continued to improve at the same rate that it has throughout the last 50 years—within which the computer and the internet both became mainstream tools—it wouldn’t be enough of an improvement to sustain GDP. Automation technology could be the answer. According to a McKinsey analysis, it could raise global productivity by as much as 0.8% to 1.4% annually—but only if humans keep working, as well.

Being an automation optimist doesn’t mean ignoring jobs lost to automation

But this prosperity didn’t immediately materialize. There was a period in which life inside of factories was miserable for the laboring class. It included paltry wages, terrible working conditions, and child labor.

Today, during what the World Economic Forum has dubbed the “fourth industrial revolution,” even optimists expect short-term labor displacement, wage depression, and, for some workers, pain. To take just one sector, the Obama White House estimated that nearly 3.1 million people could lose their job to the autonomous car. New jobs in other sectors could be created as these jobs disappear, but the people who are losing driving jobs won’t necessarily have the skills to fill the new ones. This is a big deal.

What separates the optimists from the pessimists is that they tend to believe that the economy as a whole will recover from this short-term adjustment period.

Pessimists argue that not everyone will benefit from this industrial revolution in the same way that the standard of living for ordinary workers rose after the last industrial revolution. Over the last two decades, most gains in productivity have gone to the owners of businesses rather than people who work for them. Global inequality has for the last several decades soared.

But there’s a lot of stuff going on outside of technological developments, argue the automation optimists, like the decline of unions, weakening of labor laws, tax laws that benefit rich people, and education policies that haven’t adapted to a changing world—these are policy problems, and we should fix them rather than blaming technology.

There is, however, one point that cannot be easily brushed aside. Pessimists point to the pace of innovation as a reason that, this time, advances in technology will impact jobs more brutally than they have in the past. “In the past, when you had disruption, the economy adjusted and jobs were created elsewhere,” says Ethan Pollack, an economist at the Aspen Institute’s Future of Work Initiative who says he wavers between optimism and pessimism on automation. “What happens if [in the near future], each period of disruption comes so quickly, that it never recovers?”

So who is right?

“There will be fewer and fewer jobs that a robot cannot do better,” Tesla and SpaceX CEO Elon Musk recently mused at the World Government Summit in Dubai, before suggesting that a universal basic income would be necessary. But even as he talked of the threat to jobs, he also spoke of positive impacts of automation technology. “With automation, there will come abundance,” he said. “Almost everything will get very cheap.”

The optimism camp tends to have similarly mixed feelings about automation’s impact. “AI can seem dystopian,” tweeted Box CEO Levie, “because it’s easier to describe existing jobs disappearing than to imagine industries that never existed appearing.” He doesn’t deny that automated technology will make some labor obsolete—he just focuses on the long-term, big-picture opportunity for potential benefits.

Both sides generally agree that there should be measures in place to reduce the impact of labor displacement from automation, like education programs for re-skilling workers who will lose their jobs. One side just tends to have a more darker view of what happens after that.

So which side is right? If history is any guide, both.

In the 1930s, economist John Maynard Keynes famously coined the term “technological unemployment.” Less famous is the argument he was making at the time. His case wasn’t that impending technology doomed society to prolonged massive unemployment, but rather that a reaction to new technology should neither assume the end of the world or refuse to recognize that world had changed. From his essay, Economic Possibilities For Our Grandchildren:

The prevailing world depression, the enormous anomaly of unemployment in a world full of wants, the disastrous mistakes we have made, blind us to what is going on under the surface to the true interpretation, of the trend of things. For I predict that both of the two opposed errors of pessimism which now make so much noise in the world will be proved wrong in our own time-the pessimism of the revolutionaries who think that things are so bad that nothing can save us but violent change, and the pessimism of the reactionaries who consider the balance of our economic and social life so precarious that we must risk no experiments.

The Obama White House, in a report about how automation may impact jobs, recommended responding to automation by investing in education; creating training programs for workers, like drivers, who will be displaced by automation technology; and strengthening the social safety net. Bill Gates has suggested that we tax robots’ productivity similar to how we tax humans’ income in order to finance retraining programs and jobs for which humans are well-suited, like care-taking. Others have suggested wage subsidies and direct government employment programs. These proposed solutions are not so dissimilar to those provided to President Johnson in 1964, which included “a massive program to build up our educational system” and “a major revision of our tax structure.”

Even so, little progress has been made since then in making the US more resilient to job displacement caused by automation. The cost of college education has never been higher. As a society, the US has not shown a commitment in building effective, equal-opportunity re-skilling programs. Inequality continues to increase. And the Trump Administration has so far focused on preventing companies from hiring people into manufacturing jobs overseas rather than preparing the economy for the impact of automation. This is an insufficient approach.

As MIT’s Erik Brynjolfsson and Andrew McAfee put it more recently than Keynes in their 2014 book about automation’s economic impact, The Second Machine Age: “Our generation has inherited more opportunities to transform the world than any other. That’s a cause for optimism, but only if we’re mindful of our choices.”