This city, which is the source of most major league baseball bats, was playing host this week to most of the country's major league mayors. The easiest way to understand the griping that dominated the sessions of the U.S. Conference of Mayors here is to recognize how similar the city hall politicians are to the striking baseball players.

For most of the last 20 years, the mayors and the players have been doing very well for themselves. The ballplayers, through their union, were able to push their salaries to previously unimaginable heights. They were able, through free-agent deals, to take far greater control of their own careers than they had enjoyed when they were the exclusive property of a single team and owner.

Similarly, the mayors, through their lobbying arm, were able to squeeze previously undreamed-of amounts of federal aid from Congress and the White House. And, by working their own deals in Washington, they were able to achieve far more political autonomy than they had when dealing with a single state legislature and governor.

For both the mayors and the ballplayers, the fun and games are over. The baseball owners took their first mid-season strike rather than continue the free-agent system that has given the players their contract leverage. And the Reagan administration has taken a week of denunciation for telling the mayors the days of direct dealing for ever-increasing federal dollars are over. m

Actually, as John Shannon of the Advisory Commission on Intergovermental Relations (ACIR) pointed out in a recent speech, the tide began to turn against mayors as long ago as 1975. That is when Federal grants reached their peak as a percentage of the gross national product. Through most of the Ford-Carter years they just kept pace with inflation. Now they are headed down.

President Reagan's budget plans will turn the slow decline of the last two years into a sharp downward side. The mayors estimate two-thirds of Reagan's first-round budget cuts have come from federal grant-in-aid programs. And they know Reagan's long-cherished dream of transferring responsibility for most domestic programs out of Washington means their part of the budget will continue to feel the knife.

What is almost as bad, from their point of view, is that Reagan is moving to pinch off their political autonomy in much the same way the owners are clamping down on the players' bargaining position. He is cutting off their access to Washington and forcing them to deal once again with state governments.

The device for this change is the Reagan proposal to shift most remaining federal aid from categorical grants to state-administered block grants. The initial Reagan changes were relatively modest and have been watered down further in Congress. But the mayors know there is more -- and more radical -- change still to come.

Why do mayors fear and resent being driven back into negotiating for help from their governors and state legislators?

Well, the history of the relationship is bad -- a saga of neglect. And even now, with reapportioned legislatures, better state finance systems and more professional state bureaucracies, the performance of the states, while improving, is spotty. An ACIR study on the states and distressed communities published last month concluded that "only a handful of states have ventured to develop broad and comprehensive strategies which can bring state assistance to bear on community problems in a coordinated fashion."

But, beyond that, there is a political reality. Every recent president has had a "favorite mayor": John Kennedy, Dick Daley, Richard Nixon, Dick Lugar; Jimmy Carter, Coleman Young. Reagan shows signs of developing that relationship with Ed Koch, the budget-cutting, Republican-endorsed Democratic mayor of New York, who was lionized last week by the same Time magazine cover story writer who earlier had annointed Reagan as the magazine's "man of the year."

It is easy for a president to have a "favorite mayor," because mayors have political machines presidents can borrow. A president can pay off his favorite mayor with prestige and programs, without fear that in the process, he may be creating a rival for power.

But governors rarely have "favorite mayors." Instead, governors and mayors eye each other with mutual suspicion, as rivals for power in a single state. And state legislators from suburban and rural districts often find the best politics for them lies in ankle-biting the closet big city mayor.

None of this was said in public, here, during all the formal debates on budget cuts and block grants. But it makes the mayors as frustrated as the striking players. They, too, are on the outside, looking in.