When Rep. Michael A. Andrews (D-Tex.) began his quest months ago for a seat on the House Ways and Means Committee, he thought that his merit and industry would land him the spot.

But Andrews quickly discovered that his success also could hinge on a complex web of political manuevering, ranging from muscle-flexing among House Democratic powers to the seemingly unrelated question of whether the California delegation can muscle Rep. Sala Burton (D-Calif.) onto the Appropriations Committee.

"It's something only Machiavelli could appreciate," said Andrews, 40, a Houston lawyer.

While the news is dominated by the federal budget, arms control and the presidential inauguration, House Democrats have been buzzing about something just as important to them: who gets a good committee assignment and who does not.

Because some committees are particularly desirable, the jockeying by lawmakers and entire state delegations makes for an intense and often hardball version of political musical chairs.

Vacant seats are doled out by the Democratic Steering and Policy Committee, a group of 31 Democrats that includes the Democratic leadership and some of the best deal-makers from the most powerful state delegations in the House.

"It's like the floor of the Chicago commodities market down there," an admiring Democrat said of the workings of Steering and Policy. "It's secret and its fast-moving."

Open seats on Ways and Means are among the plums. This is where tax and trade policy is decided, alternatives to President Reagan's budget and tax efforts developed, Social Security is debated and hundreds of lobbyists dealt with. A Ways and Means post can mean power, publicity and plenty of campaign contributions from political action committees.

This year Ways and Means has two vacancies, created when two Democrats ran for the Senate, unsuccessfully, instead of seeking reelection to the House. Six House Democrats are vying for those spots, scheduled to be decided Tuesday by Steering and Policy. The committee's selections can be challenged in the Democratic Caucus, but challenges have been rare.

One candidate, Rep. Brian J. Donnelly (D-Mass.), is considered a shoo-in. He has the backing of House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.), who, despite his announced plan to retire in two years, exerts considerable power over the Democrats.

O'Neill appointed eight of the 31 Steering and Policy members, and he has never lost an appointment he cared about in Steering and Policy.

The other five candidates -- Andrews and Reps. William J. Coyne (D-Pa.), Sander M. Levin (D-Mich.), James L. Oberstar (D-Minn.) and Norman Sisisky (D-Va.) -- have been engaging in hand-to-hand combat for the other seat.

They have sought the blessings of O'Neill and Ways and Means Chairman Dan Rostenkowski (D-Ill.), a wily Chicagoan who likes to run his committee like a tidy ship.

They have visited, telephoned and written each member of the Steering and Policy Committee, sometimes two or three times, and in some cases have gone to friends of committee members for help.

In most cases, the talk is not of tax policy or federal deficits but of who has been a "loyal Democrat" or a "team player" and, therefore, worthy of a plum assignment.

Loyalty includes supporting the Democratic leadership on such issues as voting for the Democratic-drafted House rules, refusing to sign the Republican-inspired petition to bring a balanced budget constitutional amendment up for a vote and sticking with a Democratic tax package.

"When I was running for the committee, Danny [Rostenkowski] sat each of us down and said, "I want you to be loyal . . . . When I really need you I want you there," said one Democrat who made it onto Ways and Means. "I don't think it's too much different this time."

Andrews is viewed by many as the leading candidate for the second seat. The seat was held by a Texan, Kent R. Hance, who made an unsuccessful run for the Senate. And Andrews' campaign effort has the support of House Majority Leader James C. Wright Jr. (D-Tex.), who commands a solid bloc of votes on Steering and Policy.

Because Hance was a "Boll Weevil" Democrat who helped Reagan pass his budget and tax cuts in 1981, Andrews more than other candidates has been pressed on the issue of loyalty.

"Mike has given solemn pledges that he will certainly be more of a team player . . . that he will not do what Kent Hance did," Wright said.

Another problem for Andrews may be that supporters of other candidates have been complaining that Texas is trying to get too many seats on important committees. In addition to Ways and Means, the Texas delegation is trying to line up a spot on Appropriations for Rep. Ronald Coleman (D-Tex.).

Texas Democrats lost four Democratic House seats in the November election, and, given their reduced numbers, some lawmakers think that Texas Democrats should not get coveted spots on both Ways and Means and Appropriations.

But, at the same time, there is talk of package deal involving Texas and California in which three California members of Steering and Policy might support Andrews and Coleman in exchange for the two Texas Steering and Policy votes for some or all of California's candidates -- Burton for Appropriations, Rep. Barbara Boxer for Budget and Rep. Douglas H. Bosco for Energy and Commerce.

Rep. Henry A. Waxman (D-Calif.), the chief dealer for the California delegation, like other participants in these potential vote-swaps, is reticent to comment on them: "You can't really talk about one committee in isolation," was his only remark.

Another strong push for the Ways and Means seat is coming from Coyne and his Steering and Policy patron, Rep. John P. Murtha (D-Pa.). Murtha, a square-jawed ex-Marine, has no official leadership title but is one of O'Neill's unofficial lieutenants.

According to fellow Democrats, Murtha thinks that one of the Ways and Means vacancies should go to Pennsylvania because that state has not been represented on the committee for more than two years. He has made it clear that he and the two other Pennsylvanians on Steering and Policy are open to any vote-swapping scheme that would help them get their way.

Michigan's Levin and Minnesota's Oberstar also come from a region that hasn't had a member on Ways and Means for years, and they think that the spot rightly belongs to one of them.

Oberstar would have to give up a subcommittee chairmanship on the Public Works Committee to make the move.

Both are well-liked, but with two of them running and only one member of Steering and Policy, Rep. Martin O. Sabo (D-Minn.), from the upper Midwest, they have an uphill battle.

The wild card in the race may be Rostenkowsi, Steering and Policy members said. Six members of Ways and Means and two other Illinois natives serve on Steering and Policy and are likely to weigh his point of view carefully.

Rostenkowski is expected to support Donnelly, O'Neill's choice, for one of the Ways and Means seats, Democrats said. But he also has encouraged Sisisky to run for the other vacant Ways and Means seat, a move that some members of Steering and Policy took as a possible shot across the bow at Wright.

Rostenkowski is mentioned as a possible candidate, when O'Neill retires in 1986, for a leadership post. He might run for speaker, a position that Wright would like to have.

But Rostenkowski and Murtha are close friends. They are rumored to have struck a deal with the Massachusetts delegation, in which the Illinois, Pennsylvania and Massachusetts members of Steering and Policy would vote as a block in favor of Donnelly and Coyne. In return, Rostenkoski would get help with other appointments, possibly getting Rep. Richard J. Durbin (D-Ill.) an Appropriations spot, according to some Democrats.

Rostenkowski did not return several calls.

"With Rostenkowski there's always a number of possibilties, and you never know exactly which he will pursue," said one Democrat. "It could be he just wants to show others he has power. Or is it a signal to Wright? Is it a signal to Murtha? Or maybe he just wants to prove he can annoint."

According to Democrats involved in the vote-swapping offers, coalitions on Steering and Policy have been forming and disbanding almost hourly and nothing is likely to be certain until the committee meets.

All of which is enough to make even those with the strongest constitutions nervous. Said Sisiski, "One day you can be on top of the heap, and the next day you find yourself at the bottom in this thing."

Added a Ways and Means Democrat who has been attempting to monitor the dealing: "I'm sure glad I have my seat."