As the impeachment inquiry into President Donald Trump continues to expand, one question comes to mind. Did Silicon Valley put Trump in office somehow? Is social media to blame for this strange presidency, or is the problem much deeper?

Facebook, Twitter and to some extent Google got a lot of bad press since 2016, not just for supposedly spreading “fake news” but also for their role in lowering the bar of public discourse. The argument is this: By appealing to our emotions in several ways, social media allowed ugly, hostile instincts to float to the surface, paving the way not just for Trump but also for similar figures to take power around the world.

So is social media to blame? Professor Margaret O’Mara of the University of Washington, author of “The Code: Silicon Valley and the Remaking of America,” laid out an interesting perspective during a meeting last week with World Press Institute fellows.

“Causality is hard to establish. Things were bad before Facebook and YouTube, but they made everything worse,” she said.

For her, social media came into an environment that was “ready to be disrupted and polarized.” One of the main factors of such an environment is the severe economic inequality. The polarization of incomes had started in the ’50s and ’60s, exactly around the same time as the civil rights movement, and that meant that people of color started gaining access to jobs they were denied before.

“This was happening at the same time that factories started downsizing and jobs started going elsewhere. For the white factory worker, this was the brown person’s fault,” O’Mara said.

The media ecosystem is another aspect of this environment. The need to fill the program of 24/7 news channels and Internet media vastly enlarged what could be considered news.

This is the environment that Silicon Valley-made platforms joined and “made worse,” according to O’Mara: “They are designed to engage us and keep us hooked. You keep scrolling because they appeal to your emotions. It could be cute puppies and it could also be something that makes you angry.”

“This is why Donald Trump is the perfect figure for the times,” the professor added. “No one feels neutral about him: it’s either ‘Make America Great Again’ or ‘the orange monster.’ ”

Even though it contributed to it, social media might not be entirely to blame for the current political climate. O’Mara still thinks that Silicon Valley was naive in not paying attention to politics. “They believed that by creating gadgets and connecting them, they would make politics irrelevant.”

Instead, she concluded: “The naiveté, combined with the incredibly powerful technological expertise, has just created a disaster.”