There is, in the change of legislative leadership here this week, a lesson in how quickly the political pendulum swings.

For the past four years, Prince George's County senators have been mourning the "good old days" when Steny Hoyer, then the leader of their delegation, was president of the State Senate and the Prince Georgians were a group to be respected and sometimes feared.

When Hoyer abandoned them in 1978 for an unsuccessful run for governor and then lieutenant governor, the Prince Georgians were dumped from power by the new Senate President James Clark Jr., from Howard County.

This week the pendulum swung once more, as CLark was ousted in a power play by a senatorial colleague from Baltimore County, Melvin Steinberg, whose success was significantly aided by the disgruntled Prince George's group.

Having backed the victor, Prince Georgians, led by Sen. Thomas V. (Mike) Miller, will be returning to positions of power equaled only by Steinberg's home county of Baltimore. Having had one position of leadership among eight senators during the last four years, Prince George's, under Steinberg, has been assured of four leadership positions and the chairmanship of a major subcommittee.

"There's no question we will have a foot in the door on anything and everything that happens," said Prince George's Sen. Arthur Dorman, who will rise from the ranks of those on the Economic Affairs Committee to become vice chairman.

"Prince George's is going to be a part of the leadership for the next year and hopefully the rest of the term, whereas we haven't been in the last four years," Dorman said. "That means that we will be involved with bills and other decisions at the leadership level before they go into committees and know when they are coming out of committees. The pendulum has swung the other way completely."

In addition to Dorman, Miller will become chairman of the Judicial Proceedings Committee, Sen. Thomas Patrick O'Reilly will become vice chairman of either Judicial Proceedings or Finance and Sen. B.V. (Mike) Donovan will become chairman of Protocol. Sen. Tommie Broadwater Jr. will head the the most important subcommittee of the Senate Budget and Tax Committee.

While Prince George's gains in the Senate, Montgomery County will not do as well. The Montgomery delegation backed Clark, who represents part of up-county Montgomery, until last week, when Steinberg was clearly the winner. At that point, a majority of the Montomgery senators switched to the Baltimore Countian.

"We didn't back the winner and there's no question that Montgomery County is not going to do as well as it has in the past, or as Prince George's will do ," said Montgomery Sen. Laurence Levitan. "Basically two jurisdictions strongly supported Mickey Steinberg -- Baltimore and Prince George's -- and add to that the black caucus, and they are going to come out best."

However, Levitan said, "we didn't do as badly as we could've." For instance, Levitan will remain head of the powerful Budget and Tax Committee and Montgomery will retain at least another seat on that committee. Others, however, such as Sen. Sidney Kramer, will not do as well. Kramer, head of the Montgomery delegation and leader of the pro-Clark forces, is expected to get booted off the Economic Affairs Committee and placed on the more out-of-the way Constitutional and Public Law Committee.

"Prince George's County has certainly gained, but I don't think it will be at the expense of Montgomery County," Kramer said after meeting with Steinberg Monday. "Prince George's will have the ear of the president, but that's fair and equitable. They should. They won."

On the House side, Prince George's, having felt shunned for the last four years by Speaker Benjamin L. Cardin, also is looking toward a more powerful four years.

With the delegation containing only a few freshmen (19 out of 23 delegates are returning), Cardin apparently has agreed to give the county five leadership positions, including a chairmanship, at least two vice chairmanships and one key subcommittee.

Del. Frederick C. Rummage, whose chairmanship of the Economic Matters Committee was thought to be in jepoardy last summer, will stay at the committee's helm despite an often-stormy four years there.

Del. Gerard F. Devlin will maintain the vice chairmanship of the Ways and Means Committee and Del. John W. Wolfgang will remain vice chairman of the Judiciary Committee, unless he gets a job in the Hughes administration, which is a possibility. If Wolfgang moves up, Prince George's will get another vice chairmanship.

Cardin also has promised to name Del. Lorraine Sheehan to a leadership post, probably the visible but largely ceremonial position of assistant majority leader, and also will give the county a major subcommittee, probably on Appropriations.

"The county's doing great, just fantastic," said Del. Timothy F. Maloney, who has criticized Cardin the past four years for not giving Prince George's a larger role in the leadership. "We went in with one voice and it's working out great."

Montgomery County, which has benefited greatly from Cardin's presence as speaker, will continue to be strong. Del. Donald B. Robertson will continue as majority leader and is expected to begin a push to succeed Cardin as speaker when the latter steps down in four years.

Robertson's closest legislative ally, Del. Helen L. Koss, retains the chairmanship of the Constitutional Administrative Law Committee, once considered a dumping ground for freshmen legislators but which has new-found muscle because of Cardin's decision to shift labor and utility bills to that committee.

Montgomery's other chairman, Del. Joseph E. Owens, remains in charge of the Judiciary Committee and Del. Nancy K. Kopp will again chair an Appropriations subcommittee.

What all this means, beyond furthering the political ambitions of those involved, is that Prince George's should find itself in a much stronger position when the time comes to fight for the ever-shrinking dollars the next four years, and when gubernatorial appointments are being fought for.

Whether this new-found power will bring the county enough money to offset the problems created by TRIM, the 4-year-old voter-approved cap on property tax collections, is a question with no immediate answer.

"There are three issues for the legislature and for Prince George's County," Miller said last week as he relaxed, feet on the desk, in his office. "They are money, money and money. At least now when we go crying to get some of it we may get listened to."