Retained earnings refer to the accumulation of past net incomes, that have not been distributed as dividends, incorporated into the legal reserves or capitalized into share capital. Dividends can only be paid out of the positive balance of the retained earnings.
As an accumulation of net income, the retained earnings are an accumulation of value, but are not necessarily an accumulation of cash (example: the net income obtained in given year was reinvested; the company increased its value, but not in cash).
The opening retaining earnings in one year corresponds to the closing retained earnings of the previous year plus the net income. Thus, it is possible to have negative retained earnings, as an accumulation of losses (negative net income).