Does anyone know how is the formula for beta, which is the sensitivity of a stock with respect to the market derived? I know that it is equal to covariance of the return versus the market upon market variance but how do you get this formula? And w…

Does anyone know how is the formula for beta, which is the sensitivity of a stock with respect to the market derived? I know that it is equal to covariance of the return versus the market upon market variance but how do you get this formula? And who derived it?

Thanks