[This answer has been updated to reflect changes to Yahoo's historical prices. It is accurate as of 2017/12/15.]
Yahoo adjusts all historical prices to reflect a stock split. For example, ISRG was trading around $1000 prior to 2017/10/06. Then on 2017/10/06, it underwent a 3-for-1 stock split. As you can see, Yahoo's historical prices divided all prices by 3 (both prior to and after 2017/10/06):
For dividends, let's say stock ABC closed at 200 on December 18. Then on December 19, the stock increases in price by $2 but it pays out a $1 dividend. In Yahoo's historical prices for XYZ, you will see that it closed at 200 on Dec 18 and 201 on Dec 19. Yahoo factors in the dividend in the "Adj Close" column for all the previous days. So the Close for Dec 18 would be 200, but the Adj Close would be 199.
For example, on 2017/09/15, SPY paid out a $1.235 dividend. Yahoo's historical prices say that SPY's closing price on 2017/09/14 was 250.09, but the Adj Close is 248.85, which is $1.24 lower. The Adj Close for the previous days was reduced by the dividend amount.