Tax works on a cumulative basis and therefore it calculates the amount earned to date, and the tax rate assumes that earnings levels will remain consistent throughout the year.
For example, if you are on the first pay period of the tax year, April 2024, and your annual salary is £70,000, you will get a gross pay of £5,833.33, and the way tax will be calculated is assuming that you will get paid the same gross for the rest of the tax year. Therefore it reduces your tax-free allowance for this month (personal allowance divided by 12) and it calculates the rest of the tax accordingly. The personal allowance is set at £12,570 for 2024/25.