What happens at year end?
The books are closed at that date and the year's figures are fixed. Everything up to it belongs to this year's accounts and tax; everything after belongs to next year's. Invoices raised, bills received, stock counted, and bank balances are all taken as at that day.
Then the adjustments. Accruals for costs incurred but not yet billed, prepayments for things paid in advance, depreciation on equipment, bad debts written off, and a stock valuation. These are what turn a list of transactions into a set of accounts, and they are mostly the accountant's work.
For a company, the accounting reference date is set at incorporation as the last day of the month the company was formed in, and can be changed. It drives the filing deadlines: accounts to Companies House within nine months of the year end, Corporation Tax paid nine months and one day after it, and the return filed within twelve months. For a sole trader, year end matters less since tax is now assessed on the tax year, but accounts still have to be made up to a date.