The CAPM is based on the premise that an investment has systematic risk and unsystematic risk. Systematic, or Beta risk, is the risk associated with being in the market and cannot be diversified away. Unsystematic risk is specific to the asset and can be diversified away.
Using the notion of Beta as a risk factor one can value an asset by calculating the present value of discounted cash flows using the following discount rate:
discountRate = riskFreeRate + riskPremium
discountRate = riskFreeRate + Beta * ( marketReturn - riskFreeRate )
Where the return on government bond rates are often used for the riskFreeRate and the return of the S&P 500 is often used for the marketReturn.
The CAPM was developed in the 1960s by William F. Sharpe who won a Nobel Memorial Prize in Economic Sciences for the CAPM in 1990 along with Markowitz and Miller.
Rumour has it Sharpe decided to do his doctoral thesis on Portfolio Theory after talking with Harry Markowitz, the father of the Modern Portfolio Theory (MPT). Markowitz had defined the MPT but had not determined a practical way (short of calculating the covariance of returns for every asset pair) to quantify the risk of a portfolio using a single quantitative factor.
Sharpe simplified the MPT risk calculation by using the covariance between asset returns and market index returns as a measure of risk. This results in a risk term known as Beta for each asset in a portolio.