An enduring theme in American politics is that the national and local governments somehow exist in opposition, that central governments grows at local government's expense.

In fact, it sometimes is the other way around. Jimmy Carter's farewell budget is an example.

It includes $99.8 billion of projected grants-in-aid to state and local governments. These grants make up about one-seventh of contemplated federal spending. They represent in turn about one-fourth of all the money state and local governments will have available to spend next year.

As mayors and governors, who are the great defenders of these grants, well understand: cut the federal budget as Ronald Reagan had said he will, and you are cutting state and local budgets as well.

Ironically, you can also end up enhancing rather than diminishing federal control over local and state decisions. The federal government seeks to restrain a program's growth by regulations limiting what program money can be spent for. Federal spending goes down; federal power, up. Reagan's job will not be easy.

The grants-in-aid go mostly, not for esoteric projects, but for basic public works and services. The largest grant program is Medicaid, health care for the poor, whose estimated cost is about $18 billion next year. The federal share of payments to welfare mothers will be $7.6 billion; federal housing aid, $4.3 billion; the federal share of school lunch costs, $3.4 billion.

For public works, the government will give out an estimated $8 billion in highway aid, $3.7 billion for mass transit systems, $4.2 billion for sewage treatment plants, about $4 billion for "community development" generally.

There are about 550 grants programs in all, but just these eight account for more than half the total cost.

The highway and sewage treatment programs are two good examples of the grant-in-aid, and how complicated grant programs may be to cut. Both are costly. Both also have strong political support from the industries they help sustain and on Capitol Hill.

The 1982 Carter budget -- a document that will surely be rewritten by both the new administration and Congress -- allocates $8 billion for highways and $4.2 billion for sewage treatment facilities.

The highway money goes to construction of interstate highways, construction and maintenance of secondary roads and bridges, and -- in a new departure in this last Carter budget -- a program of substantial reconstruction of the older interstates, which are beginning to disintegrate.

Federal sewer aid provides three-fourths of the cost of sewage treatment plants that localities must have to meet federal clean water standards. Without these new plants, many communities would have to cut off their own growth by imposing "sewer moratoria" like the ones that interrupted housing construction in the 1970s in Montgomery and Fairfax counties. Federal aid for sewage treatment is doled out on an annual basis, but many communities plan multiyear projects on the assumption of continued assistance from Washington. This is also true of highways. Budgets turn around about as fast as supertankers.

Some of the biggest grant-in-aid programs could be cut by imposing new federal standards for how the money is spent, but this would contradict the stated Reagan policy of lessening, not increasing, Washington's influence in local affairs.

For example, the subsidized housing program, which subsidizes rents and thus encourages construction of rental units, had ben run with maximum discretion for local governments. The result has been a lot of new construction -- mayors seem to like the symbolism of new buildings -- and relatively little rehabilitation of existing units. But rehabilitation is substantially cheaper than new construction, and most cities have dilapidated housing ripe for rehab. The Carter administration proposed requiring that more of the money under this program be spent on rehabilitation than on new construction, an idea the mayors and their allies successfully fought.

Housing subsidies amount to about $3.6 billion in the current budget, and Carter proposes raising that to $4.3 billion next year. However, current spending is just a fraction of what is to come, because the federal government accepts a longterm commitment to subsidize rents in every building built or rehabilitated with this money.

Meeting those commitments in the years ahead will put the subsidized housing program in the biggest grant-in-aid league, right up there with Medicaid, a federal program that involves elaborate controls imposed by Washington. Medicaid expenses this year will cost the federal treasury $16.5 billion; for fiscal 1982 the Carter budget asks for $18.1 billion.

Every one of the grant-in-aid programs has a political life of its own. For example, the sewer program is looked after by effective lobbyists for the industry that makes the equipment (pipes, for example) used in sewage treatment.

A serious threat to the sewage treatment program would also bring out the real estate lobby, which would rightly fear arbitrary restrictions on growth in some communities if the flow of sewage treatment dollars were slowed.

Similarly, the highway lobby is a known power in Washington, but it has lost battles in recent years. There is already an accumulated backlog of maintenance requirements in the federal highway system -- the first of them opened in the late 1950s -- that has not been met. For the first time, Carter's budget proposes a large allocation of federal funds to repair the deteriorating highways.

Unfinished links in the federal system are also a hot political issue in many communities. Former congressman David A. Stockman (R-Mich.), the incoming director of the Office of Management and Budget, has encountered this first-hand. A key highway in his old Michigan district is scheduled to be linked by a federally financed bridge, which local residents fear could fall to a budget-cutting ax.

And much of the government's highway aid comes to local governments on an all-but-irresistable 90-10 formula: 90 percent provided by Washington, the rest contributed locally. A 90-10 habit is hard to break, as the Reagan administration will discover if it moves to change any of the customs in the grant-in-aid programs.