Historically, government employees were lifers. The pensions are designed for it. So if you want to jump around, then yeah, there will be consequences.
Couple things you need to be aware of regarding pensions. First, the eligibility and contribution requirements. Second, the funding status.
All this information will be available online. You can google to find the plan's website, or if that isn't working you can go find the financial statements for your local government entity. Why? Because accounting standards require that government entities that have pensions include a whole bunch of info about the plan in its financials.
So, examples here. You're in Illinois and you google (or know) and find IMRF, which is the state wide municipal retirement plan.
https://www.imrf.org/Or, you know that you are looking at getting at job in the City of Chicago. So you google "city of chicago ACFR" or "city of chicago financial statements", then get in the financials and search for pension. Eventually you'll find the name of it. (Chicago isn't part of IMRF, they have their own plan.)
Chicago's 2022 ACFR:https://www.chicago.gov/content/dam/city/depts/fin/supp_info/CAFR/2022CAFR/ACFR_2022.pdf the pension footnote starts on pdf page 92.
OPEB = other post employment benefits = health insurance for retirees.
Benefits, eligibility, vesting, etc matter for obvious reasons. Funding status matters because if the plan is largely unfunded, then there's a higher chance that it's going to ultimately fail, or benefits will be cut, or something. This is a real concern. A lot of places made grand promises when times were good and then started to run into problems when times were bad. The stock market going up has helped some.