Although the political world affects the stock market in the short term the market recovers quickly.
What drives the stock market the most are interest rates, inflation, and corporate profits. Interest rates are set by the Federal Reserve. Federal policy is set through the raising or lowering of interest rates. Interest rates help dictate the demand for goods and services. This in turn affects corporate profits and inflation. Interest rates set by business and industry are set according to what people believe the Federal Reserve will set long term interest rates at. This forecasting of interest rates is driven by what the Federal Reserve is projected to do in the future. High interest rates alter borrowing costs. This has the effect of changing the availability of bank loans and household wealth. Lastly, interest rates affect foreign exchange rates (Federal Reserve San Francisco).
Corporate profits drive the stock market either up or down depending upon whether corporations have a gain or a loss. Large corporate profits give corporations more to spend or reinvest in the corporation. The gains are passed on to investors through increase in value of the company's stocks and larger dividends. Most dividends are reinvested into the corporation thus increasing growth potential of the corporation. Corporate losses have the opposite affect. Losses are passed on to corporate stock holders in the form of decreased stock value and lower dividend payments. What also drives stock prices is corporate reporting. A corporation that has had a positive growth fiscal year tends to prompt a rise in the value of its stock. Likewise fiscal reporting that falls short of forecasts has the effect of lowering stock value. In addition to reporting results, a corporation's non-compliance with reporting requirements or late reporting has the affect of lowering its stock value. Mainly, this is because non-compliance is most associated with problems within the organization or reports of an external investigation by the SEC (Securities and Exchange Commission).
Corporate earnings have the trickle down affect of the raising or lowering of purchasing power of its stockholders and employees. Employees often benefit from owning company stock through a corporate stock option program that awards stock to employees as retirement compensation. A company seeing losses passes that loss of value on to its employees by lowering of the stock price. This has the affect of lowering the value of the employee's retirement plan. A win-win situation would be employees working hard to assist the corporation in making profits because both the corporation and the employees benefit from higher stock values.
As long as corporations and individuals have buying power they will exercise that power by purchasing more stocks. That, in affect, gives the corporation more money to spend on operations that make money for the corporation. Thus stock market values rise (Bull market). The inverse lowers stock values and reinvestment and the stock market experiences a bear market.
Lastly, a war has an interesting affect on the stock market. Initially, the announcement of a conflict serves to drive the market downward. But, once war production begins and corporations begin to make money because of the conflict the stock market is driven up.