Both represent increases to a company's equity, or capital, but coming in two different forms.
Contributed Surplus is money or property the owners have invested in the company. (OK, technically, the portion of their investment that's over the par value of the stock they received; sometimes aka Additional Paid In Capital).
Retained Earnings, on the other hand, represents profits the company's made, but hasn't paid out to its owners (hence the name).
So roughly speaking, you might think of CS as the owners writing checks to the company, while RE is the owners choosing to leave some profits in the company, instead of taking it out.
I hope this helped.
...it was early and I was full of no coffee...