An example
For instance, in 2020-21 the Higher Rate on income tax in England is 40% on earnings between £50,001 to £150,000 (assuming you have the full £12,500 personal allowance).*
So, suppose your salary is £90,000 and you have two goals - repaying your mortgage early and retiring one day at 55 (or 57, as noted above). How do you decide how much to commit towards each goal? Without considering how taxes feature in the matter, you potentially stand to waste money which may otherwise have moved you closer towards your goals.
Bear in mind the current rules about tax relief on pension contributions: at the time of writing, Higher Rate taxpayers receive 40% relief. So, suppose you could afford to contribute £30,000 out of your £90,000 salary towards your pension each year. 40% relief on this amount adds up to £12,000 which goes into your nest egg.
Had you otherwise put all of this towards overpaying your mortgage, the £12,000 would have gone to the taxman instead.
*Please be aware that you will lose your personal allowance on a 2 for 1 basis on earnings over £100,000.