The Federal government and all state governments have a tripartite division of power into the legislative branch, the executive branch, and the judicial branch—usually quite explicitly in state constitutions—de jure; now-a-days it is increasingly no longer de facto.
The administrative state, run by unelected bureaucrats, have increasing taken over writing, enforcing, and judging the law without input from an elected official, in many cases aren’t even appointed or confirmed by elected officials.
Career civil servants who are not appointed by elected officials, but simply rise through the ranks, are increasingly writing rules that they enforce and adjudicate violations—all sans the input or say of any elected official or person appointed/confirmed by an elected official. Especially in cities, the cities are not run by city councils or mayors, who might approve of city codes and the like, but in actuality by career civil servants. Though city managers are often hired by a city council, they operate as autonomous overlords, and often go rouge. These civil “servants” game the system to become rich kleptocrats with massive guaranteed benefits and six-figure pensions for life (usually after a surprisingly short amount of years).
It has become less the situation of government employees enforcing the law as written under the guidance and direction of elected or appointed/confirmed officials, but of laws being written to direct agencies and department’s heads to come up and enforce whatever they want within a broad policy goal, with the actual rules and enforcement being done by career civil servants with, at best, the rubber-stamp approval of some nominally operating elected official or appointed/confirmed official.
Punishment, too, is being left to these career civil servants, either by blind deference or by allowing the civil servants to punish people with fines or just outright confiscate that person’s property!
It is often argued that the administrative state and guidance by “experts” (a longtime hallmark of Progressive governance) who work independent, as much as possible, by the hoi polloi, is necessary since government has gotten to big for the people, or their elected representatives, to understand how to run or even how to govern at all. The only way to fix this is to reduce the scope of government, and to use laws written by the legislative branch, as much as possible, such that regular people will be able to adhere to and follow without expensive legal representation; when more specific regulations or rules are necessary, they should be limited to regulating their own operations or to applying facts to specific guidelines… and always to be approved by an elected official, or an official who has been directly nominated/confirmed by an elected official (or officials).
Without addressing this root cause, the problem will never be solved.