Retained earnings are, by definition, the sum of the accumulated profits and losses in the years since you started trading. This is why it shows as the sum of each year-end journal. The Aggregate Profit/Loss then adds on the current year’s profit (or subtracts the loss). If there have been dividends paid in the current year, these are also taken off to arrive at Total Distributable Profit.
You cannot pay dividends unless there are sufficient reserves - you cannot just look at the current period you must take into account the reserves brought forward when determining how much your distributable reserves are. If you had made losses for the first three years, and then made a profit in the fourth year, you are not allowed to pay out that profit as dividends - you must first subtract the accumulated losses and only then, if there is still money left, can you pay a dividend.
The £25,000 you mention is not money that is in your bank account - if you look at the balance sheet you will see that retained earnings plus the current year’s profits to date plus share capital are equal to the sum total of your assets less your liabilities, i.e. it will be your bank balance plus any money owed to you plus fixed assets less any debts you owe.
Feel free to message me if there’s anything you’re still unsure of.