Synthetic cash

Can anyone please help me to clarify the following statement?

“The investor has a dividend-paying stock and wants to lock in a future selling price. The investor might enter into a forward or future contract. Because initial and final stock prices are known, this investment should earn the risk-free rate. What actually happens is that the dividends earned on the stock + return from the futures contract equal the risk-free rate.”

Why does the investment earn risk-free rate? What kind of return do the futures earn?

Because it’s risk-free. If it earned anything other than the risk-free rate, there would be an arbitrage opportunity.

The prevailing risk-free rate at inception.