he current and apparent future governor of Illinois, James R. Thompson, was asked how he had blown his big lead last Tuesday.

"If I had it to do over," said the man called Big Jim, "I'd take half the money I've spent on polls and use it for another thousand precinct workers."

Certainly the pollsters -- Thompson's and everyone else's -- missed this one by a mile. Right up through the final week of the midterm election campaigns, they showed the governor leading Democratic challenger Adlai E. Stevenson III by margins ranging from 16 to 20 percentage points.

At the moment, Thompson leads by two-tenths of 1 percent, and Stevenson has refused to concede, claiming the outcome will change once a canvass is completed by the middle of next week.

What happened?

"Those polls are taken over the telephone, and in a depression a lot of people don't have phones," said Stevenson, choosing his words pointedly.

That may be part of it, but analysts believe that it was the combination of a strong nationwide anti-Reagan vote, a tour de force by the Chicago Democratic machine and some effective last-minute negative advertising that turned the tide.

Indeed the new conventional wisdom, spruced up by hindsight, is that it's a wonder Thompson managed to eke out a virtual tie in his bid for an unprecedented third term.

"The only thing that kept it close was the brilliance of Thompson's campaign and the total ineptness of Stevenson's," said Don Rose, a veteran local political consultant who has worked for Democrats and Republicans.

The foibles and failures of the Stevenson effort have been well chronicled. They are symbolized by his now-classic "wimp" denial, which had the disastrous effect of focusing the campaign on personality rather than on the economy.

Rose said that the pocketbook issues did not take hold until late, when, with an assist from President Reagan, the race was "nationalized."

The result: Chicago got the same heavy turnout of Democratic voters as big cities all over the country. There was something else going on here, too: a community-based registration drive that added 100,000 black voters to the rolls this year.

The Cook County Democratic machine at first resisted that drive, fearing that the blacks will vote against Mayor Jane Byrne in her bid for reelection next year. But once it saw it was going to happen, the organization made more registrars available in the black community, hoping, in this campaign anyway, to harvest what the community had sown.

Chicago gave Stevenson a whopping 460,000-vote plurality, reducing Thompson's percentage of the vote from 39 four years ago to 27 last Tuesday.

How much credit does the machine get?

That's always a tricky question. The performance of political organizations is best measured by the way they deliver for low-visibility offices in party primaries. In a race between two well-known candidates, all the other factors of modern politics--media, personality, even issues -- come into play.

The machine's role in the Stevenson-Thompson race is further muddied by the pre-election speculation that Byrne was supporting the Democrat publicly but playing footsie with the Republican. It was said she wanted to be with a winner, and that she distrusted Stevenson as an ally of State's Attorney Richard M. Daley, her opponent in next year's mayoral race.

But on Election Day, there was apparently no holding back on Stevenson. The election was the first for the county's new Democratic boss, Edward R. (Fast Eddie) Vrdolyak. He wanted a big win to establish his clout, and the way you get one in this town is for your committeemen to urge voters to punch the straight Democratic line.

One other factor broke for Stevenson. In the last two weeks of the campaign, he began airing television and radio spots that skillfully tied Thompson to Reaganomics and reminded voters what they did not like about the incumbent: his imperial governorship. One spot focused on Thompson's lavish use of bodyguards and his installation of a private office elevator.

A final word on the polls comes from that classic Chicago political insider, the cabdriver. En route to O'Hare Airport, from the horse's mouth:

"Look, Stevenson's a schnook, no personality, right? But he's an honest schnook . . . . No pollster is going to tell me that a man named Adlai Stevenson, whose grandfather was a vice president, whose father ran for president twice, and who's never lost an election in his life, is going to lose in this state by 20 points. That's crazy."