The midterm elections Tuesday have huge stakes not only for the future of health care, taxes and immigration, but also for the U.S. economy and investors. Polls and forecasters suggest Democrats have a good chance of taking control of the House, while Republicans are favored to keep a slim majority in the Senate. But deviations from the expected outcome could have massive implications for investors. Experts consider the GOP holding control of both chambers the second most likely outcome, followed by a Democratic sweep of Congress. It would be virtually impossible for Democrats to win the Senate without also gaining control of the House. Each of those results would lead Congress to pursue different policy initiatives — and potentially block any progress toward those goals. Here we break down the likelihood of each scenario playing out, as well as what they mean for the overall market and individual stocks.

Scenario 1: Democrats take House, GOP keeps Senate

Overall stock market: Modestly bullish

Winners: Drug stocks, defense stocks Top forecasters consider Democrats flipping the House and Republicans retaining the Senate the most likely outcome. Projections from data journalism site FiveThirtyEight give Democrats about an 85 percent chance of taking House control by flipping at least 23 seats, and the GOP about the same chance of holding the Senate. It would lead to a divided Congress, likely with a somewhat narrow majority in both chambers. That may lead to more gridlock than bipartisan cooperation. While a divided government would make it hard for policy initiatives to move forward, stocks usually do well when there is a stalemate in Washington.

"Historically stocks have thrived in gridlock," said Joseph Song, U.S. economist at Bank of America Merrill Lynch. "Under a Republican president, a split Congress has been the best outcome, yielding 12 percent average annual returns for the S&P 500." Lori Calvasina, head of U.S. equity strategy at RBC Capital Markets, said in a note the market has been expecting this scenario and clarity on this front will be bullish. "Equity investors have been expecting a split Congress," she said, noting few believe "a sweep by either party is probable." The potential for impeachment: House Minority Leader Nancy Pelosi — the favorite to become speaker in a Democratic House — and other Democratic leaders have so far sworn off talk of impeaching President Donald Trump in order to avoid stoking fury in the Republican base. But if their investigations into the administration or special counsel Robert Mueller's Russia probe reveal new information, Democrats could pursue it more aggressively. Even the higher possibility of a Trump impeachment could spark more market volatility. "If impeachment proceedings are considered, as they might be today, this would represent a macro 'shock,'" Song said. "The market has generally recovered much of the initial sell-off from historical shocks, in many cases due to central bank policy responses. In today's case, one key risk under potential impeachment would be that of reversing tax reform, which has contributed double digit earnings growth to S&P 500 companies." Still, even if the House impeaches Trump, a GOP-controlled Senate likely will not vote to remove him from office. The war over health care: On the policy front, Democrats and Republicans may struggle to find common ground. Both parties, including Trump, have stressed the need for an infrastructure overhaul. But since Trump became president, lawmakers have struggled to reach a consensus on exactly what an infrastructure plan would look like and how it would be funded. The situation may not change with split control. On health care, Democrats want to shore up the Affordable Care Act to curb rising premiums — and some want to take even more action to expand the government's role in health care. They may not find common ground with Senate Republicans. Senate Majority Leader Mitch McConnell has said the GOP could move again to repeal Obamacare if it gains enough Senate seats. Impact on Big Pharma: While Trump recently unveiled a proposal intended to cut Medicare drug prices, he has shied away from his campaign promise to allow Medicare to negotiate directly with drug companies. Democrats also support that proposal and expressed dismay when Trump appeared to abandon it. Investors have already priced in a lack of meaningful drug-price reduction legislation being passed, according to David Kostin, chief U.S. equity strategist at Goldman Sachs. The S&P 500 health care sector has climbed more than 7 percent this year and is one of the best performers of 2018. "The performance of Pharma stocks has tracked the prediction market likelihood of a Democratic victory in the House, suggesting investors believe a divided Congress would reduce the likelihood of major regulatory changes regarding drug pricing," Kostin said. Some stocks that could benefit from this scenario are Celgene, Regeneron Pharmaceuticals and Amgen. Celgene and Regeneron are down for the year, while Amgen is up more than 10 percent for 2018. Kostin included them in Goldman's Government Exposure basket, which is made up of companies with at least 20 percent revenue exposure to government spending. Gains for defense: With Trump and the GOP fixated on boosting defense spending, funding for the Pentagon would also likely go up again with divided control of government. Democrats just agreed to a Defense Department budget increase for fiscal year 2019. This could give defense stocks a boost after the election. The iShares U.S. Aerospace and Defense ET is up more than 4 percent this year, outperforming the S&P 500.

Scenario 2: GOP keeps both, but narrower House majority

Overall stock market: Very bullish

Winners: Tax cut beneficiaries, refiners, consumer discretionary While Democrats have the inside track to gaining control of the House, Republicans could keep a majority if only a handful of toss-up races break their way. The GOP has a small — but still realistic — chance of holding the House. The political data website FiveThirtyEight pegs it at about 15 percent. While the chance of Republicans holding both chambers is slimmer than the prospect of Democrats winning the House, the outcome would likely have bigger implications for economic policy. The return of tax cuts and Obamacare repeal: Unified GOP control would inject more life into the Republican push to repeal and replace Obamacare. Aside from McConnell, Vice President Mike Pence has also said the party could try again to overhaul the health care law if the elections go well. Republican control of Congress also could affect tax policy — particularly if the GOP can expand its Senate majority past the current 51-49 seat edge. In September, the House passed three bills known collectively as "tax reform 2.0." McConnell has said the Senate would take up the plans — the most notable of which would make the individual tax cuts passed last year permanent — if he sees support for them. Trump also recently floated an additional 10 percent tax cut for middle-income Americans. The proposal came a couple weeks before the midterms and appeared to catch many Republicans and even White House officials off guard. While it is unclear now whether such a plan could pass even in a GOP-controlled Congress, House Ways and Means Committee Chairman Kevin Brady, R-Texas, said he wanted to work toward drafting a tax bill if his party holds control of Congress. Senate Finance Committee Chairman Orrin Hatch, R-Utah, called it "highly unlikely" that such a bill would pass this year in the current Congress. A boon for refiners and retailers: Still, Republicans fending off the Democrats' so-called Blue Wave would be the best outcome for stocks, at least for a moment. "In the short term, U.S. equity markets could perhaps benefit from renewed hopes on taxes and deregulation," said Johannes Mueller, head of macro research at DWS. "In the longer term, the risk of the U.S. economy overheating would increase." Trump signed a bill late last year that slashed the federal corporate tax rate to 21 percent from 35 percent. This has contributed to double-digit earnings growth for the S&P 500. Expectations of lower corporate taxes also boosted stock prices all throughout 2017, with the and Dow Jones Industrial Average rising 19.4 percent and 25.1 percent, respectively. S&P 500 and Dow in 2017 Source: FactSet RBC's Calvasina said a Republican sweep would benefit refiners. The VanEck Vectors Oil Refiners ETF is up only 2.5 percent this year and has fallen more than 8 percent in the past six months. She also said shares of Exelon, a nuclear power company, could benefit from a Republican sweep. Goldman's Kostin, meanwhile, says companies with higher taxes would get a boost if Republicans hold a majority in both chambers as their taxes would go lower. Lower taxes would also benefit consumer discretionary shares — which include retailers like Amazon — according to Bank of America Merrill Lynch, as consumer spending gets a lift. The immigration factor: One policy area will still challenge Trump even if Republicans keep control of the House: immigration. Democrats are virtually guaranteed to cut into the GOP's majority even if they fail to take control of the chamber. The more moderate members of the House Republican caucus — at least some of whom would have to hold their seats for the GOP to defend its majority — do not support the president's immigration priorities. With a smaller Republican majority, passing a GOP-led immigration overhaul would still likely prove daunting.

Scenario 3: Democrats take the House and Senate