In the steamy weeks of June and July, when the success of President Reagan's program was no foregone conclusion, a balding midwesterner with a farmer's ruddy complexion steadily patrolled the House of Representatives, keeping his troops in line.

Often he could be seen sitting quietly with a recalcitrant comrade, head bowed, listening intently. Was there something he could do? A 3-by-5 card would come out, and a note would be made.

Bob Michel, the modest man from Peoria, Ill., shuns the limelight. His is not the familiar face on network television or the covers of news magazines. People misprounounce his name (it is MIKE-ul) and this gregarious, somewhat rumpled chieftain of House Republicans moves through the Capitol's corridors unrecognized by summer tourists.

But behind the glossy PR of last-minute speeches and telephone calls from the White House, Michel helped muscle the Reagan economic program through a Democratic House in a sustained display of the kind of behind-the-scenes leadership that often matters most in Congress.

Admittedly, the 24-year House veteran hesitated at times, thinking the program too radical and the White House tactics too reckless, but in the end, he decided, "They're really writing the music. I gotta go up there and direct the doggone stuff. It may be a good symphony and it may not."

If Budget Director David A. Stockman's vision gave birth to the Reagan program, and his aggressiveness sustained it, it was Michel's patient massaging of cranky legislators, long hours of listening to petty complaints, endless meetings over numbers and programs and compromises, that helped clinch the victory.

Take Ralph Regula of Ohio, the No. 2 Republican on the Budget Committee, a workhorse job with little glory. He wanted to put an item in the tax bill, a depreciation provision that would have helped his district. The Treasury Department wouldn't hear of it, but Michel arranged for Regula to meet with the president. "It didn't get in," Regula said, "but Bob really went to the mat for me. And the president thanked me for my work on the budget."

Michel is a master at small favors. He gave a speech in Regula's district, and, when the Ohioan's son came to town, Michel let him listen in on a strategy meeting that made him proud of his father's role.

Thanks to Michel, Regula said, "I'm more loyal now than I was at the beginning. Reagan is the general, but a general can't win a battle without a lieutenant like Bob to inspire the footsoldiers. The lieutenant knows which troops need a little stroking."

When Robert H. Michel won the top party job last December, he changed the title on his door from "Minority Leader" to "Republican Leader." A small symbol, given the Democrats' 53-seat advantage and their hold on powerful committees, but a symbol nonetheless of a change in style from the era of John J. Rhodes (R-Ariz.) who presided over a guerrilla war in which Republicans postured, but often accomplished little.

"I'm tired of the minority mentality," Michel told some fellow Republicans early on, and proceeded to forge a coalition with conservative Democrats, ignoring the history of distrust and partisanship among his colleagues. Should the Republicans gain a score of seats in 1982, and should a few conservative Democrats switch parties, Michel could be the next speaker of the House.

No great orator, Michel, who calls himself an "institutionalist," is the quintessential club member who succeeds in the swirl of congressional egos by downplaying his own role.

"I'm a servant of the president," he said. "I like being a good soldier." Suggest he might now be the leader of a majority in the House, he shakes his head slowly. "Aw, shucks," he said, "I cringe at that."

Apart from his courting of southern Democrats, Michel's feat was to forge a united GOP block behind Reagan's budget and tax bills, despite a prickly group of moderate Northeast and Midwest Republicans who were used to voting with the Democrats. "Holding 190 Republicans on vote after vote the way Bob Michel did was a major miracle," said Max L. Friedersdorf, the assistant to the president for legislative affairs.

Michel's relations with his former colleague, the younger, flashier Stockman, director of the Office of Management and Budget, were strained at times.

Stockman pushed Michel to reject budget cuts made by Democratic-controlled committees, and substitute an administration alternative. Michel worked to whittle down the substitute until it affected the work of only six committees, and helped persuade Stockman to accept $2.8 billion in sweeteners for moderate Republicans. "We don't have a dictatorship up here yet," Michel snorted in a rare moment of public annoyance.

The two also clashed over whether the Senate should accept the House budget bill, as Stockman wanted, and thus avoid a House-Senate conference. Michel and Senate Majority Leader Howard H. Baker Jr. prevailed.

"Dave is an ideologue. Bob is a politician," said a staffer who works with both. "It was the tortoise and the hare. Michel may be a plodder, but Dave is overzealous. Without Bob, Dave would never have made it."

House Republicans were also annoyed at their lack of input into the tax bill. Michel was openly critical of the way the White House handled its hastily announced and subsequently withdrawn proposal to cut Social Security benefits. But in general, the Republican leader kept his irritation to himself, managing to chisel away at White House proposals to make them more acceptable to legislators.

When Congress returns from vacation in the fall, however, to deal with more billion-dollar budget cuts and such fractious issues as Social Security, abortion, immigration, the Voting Rights Act and the Clean Air Act, Michel predicts "it's going to get rougher."

The coalition of Republicans and conservative Democrats that sustained Reagan through the spring and summer "will only work at selected times on such broad economic issues," as the first budget and tax bills, Michel said.

"We can't come in here every day and say we've got it by the you-know-what. The executive branch feels strongly we've got to go back and put it together again for the Gipper. But there's going to be division and breakdown with a geographical, parochial flavor. A conservative Texan and a conservative from Illinois may be on different sides. Would I vote the same on wetbacks as a guy from Arizona?"

Son of an immigrant French factory worker, Michel, 58, was born in Peoria and was on his way to becoming an insurance salesman when he landed a job as an aide to an Illinois congressman.

He replaced his boss in 1957, and became known in his years on the Appropriations Committee as a team player, a fiscal conservative, a hard worker and an unpretentious nice guy with a vocabulary full of words such as "super-duper" and "hells bells."

Michel became Republican whip in 1974. During countless hours spent on the floor of the House chamber, he came to know each member's quirks and problems back home.

"Each member is a separate entity," Michel said. "You can't treat two alike. I know what I can get and what I can't, when to back off and when to push harder. It's not a matter of twisting arms. It's bringing them along by gentle persuasion. Sometimes they don't realize they're being brought into the orbit. You get down to the end of the walkway and you say, 'Hey, we aren't 2 cents apart, are we?' and he says, 'Well, I guess we aren't.' "

Take the little matter of who would sponsor the president's budget bill.

At first, Ohio Rep. Delbert L. Latta, ranking Republican on the Budget Committee, objected violently to allowing the outspoken Texas Democrat, Phil Gramm, to cosponsor the bill. "There were some rough moments," said one Republican congressman involved. "We didn't know until the last minute whether we'd have a bipartisan package. And without that, we couldn't win."

But Michel met with Latta again and again, assuring him that he would take the heat if the plan backfired. If Gramm were allowed to introduce the bill in committee, Latta could introduce it on the floor. Latta finally agreed, but the relationship was delicate enough that even today, one prominent Republican said, "When I'm with Del, I talk about the Latta-Gramm bill. When I'm with Phil, I say Gramm-Latta."

Michel recognized early on that some 30 Republicans from moderate northeastern and midwestern districts were as much a swing group as conservative Democrats. He set up meetings with Reagan for nine of them, and tirelessly pushed their proposals.

"He knows the mechanics of building a coalition," said Dick Cheney (R-Wyo.). "When you have 435 personalities and you're trying to put together 218, it's the closest thing to nonviolent combat there is."

Michel's cordial relations with Democratic leaders were also critical to the administration's success. In the first weeks of the session, Michel's staff took big charts around, pointing out that the House had only 119 legislative days to pass an economic program-- and the Democrats wouldn't want to be labeled obstructionist, would they?

House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) -- who plays golf with Michel from time to time -- announced a stepped-up timetable, which in the end proved to be an important advantage for the Republicans.

On the floor, Michel could be tough, at one point rallying his followers with the cry, "These are no longer our amendments. These are bastards of the worse order."

He accused the Democrats of "phony cuts and bookkeeping chicanery" and even "dirty tricks" on one occasion when a couple of Democrats intercepted the Republican's reconciliation bill on the way to the printer.

There were spur-of-the-moment decisions on how to turn around the momentum of a debate (as during the spat over the intercepted bill), the sudden abandonment of an amendment (as when Michel decided he might lose the whole budget bill if he forced a separate vote on Energy and Commerce Committee provisions), or the last-minute rounding up of three Republicans to compensate for unexpected Democratic defections.

Yet after all the rhetoric, Michel would still be friends with the guys on the other side of the aisle. In the last days before the August recess, he managed to forge a compromise allowing Democrats to save face by voting to restore minimum Social Security, while leaving the president's cuts intact. "The Republicans are fortunate to have him," California Rep. Leon E. Panetta, the Democrat's budget wizard, said.

Whatever happens in the fall and beyond, Michel will be a key player.

"If you're not concerned over who gets the credit," he said, "you might be doggone surprised over how many things you can get accomplished."