You have misunderstood your pension.
Forget about what you pay per month - think of whatever you pay as a monthly subscription fee to access the pension scheme and not an actual sum of cash you are putting in a savings pot.
Say you earn £49000 per annum in your local government job and your pension scheme is based on 1/49
Year 1 of being in the scheme you have therefore now been allocated £1000 a year (1/49 of £49000) in your pension forever. So even if you only work for 1 year in local government you will always get that £1000 per year.
Year 2 you earn the same money and subscribe to the same scheme so they add another £1000 per year to what you will now get per year forever even if you now leave/retire after 2 years.
Year 3 the same happens and now your annual pension forever if you leave/retire now is £3000
and so on and so on
So by the time you have done e.g. 13 years in a local government pension scheme on £49000 a year (assuming your salary never changes) your annual pension every year if you retire after 13 years would be £13,000 (£1000x13 years)
What you pay from your monthly salary towards that £1k a year (e.g £250ish per month = 6.4% of your monthly salary or whatever percentage your employer sets) is essentially a subscription fee to access a better pension for every year you stay in the scheme.
The longer you work for local government the better your pension is as every year worked adds a bit extra every year to the annual amount they will pay you in retirement.
You can get a refund if you only work for local government for a couple of years and your monthly 'subscription fee' in that time works out less than what you will get back as an annual pension later.