FBI agents believe they may have cracked the main illegal gun-running operation from the United States to guerrillas of the Irish Republican Army -- and have discovered, almost by accident, that one of the most powerful figures in the Provisional IRA enetered this country illegally in March and may still be here.

The arrest of three men in Queens, N.Y., last month was the climax of a long investigation in which agents posed as gun dealers and were allegedly offered $16,000 in cash by the men for 42 automatic rifles and handguns. Authorities said they found the men already in possession of a formidable supply of arms, including three carbines, an anti-helicopter cannon, a flamethrower, rifles and ammunition including a supply of armor-piercing shells.

According to sources familiar with the investigation, when FBI agents searched the home of one of the men they found the Irish passport of Joe Cahill, formerly commander-in-chief of the Belfast Brigade of the Provisional IRA and now an important member of its high command in Dublin.

The discovery of Cahill's passport, as well as causing considerable concern, has led agents to believe they may have uncovered a highly organized channel for gun-running across the Atlantic, according to sources. Previous arms finds, and prosecutions, have apparently failed to stop the regular flow of guns to Northern Ireland, where British authorities estimated recently that 47 percent of captured weapons originated in the United States.

Meanwhile, a trial in Glasgow, Scotland, has revealed attempts by the Ulster Vounteer Force, an extreme Protestant paramilitary group, to establish its own pipeline for weapons from the United States. Six men have been found guilty of bringing two machine guns, disguised as spare car parts, to Scotland for eventual use in Belfast.

The two fully automatic Ingram machine guns, which can fire up to 1,000 rounds a minute, originated in Atlanta and are believed to have been stolen from a consignment destined for a U.S. law enforcement agency. Such weapons cannot be purchased by the general public in this country.

Authorities say the shipment via Scotland was intended as a trial run for a new supply route which Protestant militants were hoping would compete with the IRA's apparently well-established arms channel, but the plan was nipped in the bud by police.

The triple arrest in New York is seen by authorities as a major breakthrough in interrupting the flow of arms to the IRA. Thomas Falvey, 56, George Harrison, 67, and Patrick Mullin, 43, all of Queens, appeared in court this week to face grant jury indictments charging them with receiving and possessing firearms not registered to them, possessing firearms on which serial numbers had been obliterated, and planning, with co-conspirators known and unknown, to export the arms to the IRA in Ireland.

All three pleaded not guilty.

Apart from the arms find itslef, the FBI is said to attach considerable importance to the discovery of Cahill's passport in Harrison's home since it indicates that at least one of the men was in direct contact with the Provisionals at the highest level.

According to a source familiar with the investigation, one theory is that Cahill traveled to the United States in early March in connection with a major arms deal, something in which he has specialized in the past. In 1973, he was arrested on board a ship in the Irish Sea which was carrying 50 tons of arms from Libya, including a large quantity of Soviet-made arms. He was jailed, but later released on grounds of ill health.

As long ago as 1942 Cahill was sentenced to death with five others for the murder of a Belfast policeman. He sentence was later commuted. He has long been regarded by Irish and British authorities as one of the most dangerous men in the IRA, and the knowledge that he may have been in the United States for more than three months has sparked an intensive search. He has been refused an American visa in the past.

Irish authorities are believed to have reported no evidence that he has returned home. He is a well-known figure to security authorities in Dublin.

There have been several arms finds in the past two years. They have included the discovery of two separate shipments of guns in the holds of jumbo jets at Kennedy Airport bound for Ireland and the uncovering -- by chance, during a fire-fighting operation -- of a store of M16 rifles, handguns and ammunition in Walpole, Mass., in April, 1980.

This haul was traced back to a major theft from an armory in Danvers, Mass., in 1976, and several weapons taken in that raid have since been captured from the Provisional IRA in Belfast, according to a source close to the investigation. As a result, it is thought that the cache found at Walpole was a store from which regular shipments were crossing the Atlantic.

After the most recent find at Kennedy earlier this year, one FBI agent said he believed the bureau was on the verge of breaking oppen one of the most important IRA "cells" in the United States and was only "a step and a half" behind the treasurer of the operation.

The latest arrests are regarded as an important step forward.

At present it is estimated that the active forces of the Provisional IRA and the Irish National Liberation Army in Northern Ireland number fewer than 500, so the number of guns required is not particularly high. What is needed is a safe channel from the United States so that suitably sophisticated weapons can be transported quickly to replace those which have been captured, and a regular supply of funds to finance the gun-running