There were two halves. The first was the sale of missiles and spare parts to Iran, a country the United States had embargoed, which was then at war with Iraq, in the hope that Iranian contacts could get American hostages out of Lebanon. The second was the financing of the Contras, which Congress had cut off by law in the Boland Amendment after finding out what the Central Intelligence Agency had been doing in Nicaragua. Congress had banned it. The two halves grew into each other, and the profits from one paid for the other.
The work was done by staff at the National Security Council rather than by the agencies, which is why it took so long to find. Oliver North, a marine lieutenant colonel, ran the Contra side and kept a network of private funders, aircraft and bank accounts in Switzerland. North destroyed documents. John Poindexter, the national security adviser, authorised it. Poindexter authorised it. Several million dollars in profits went through a Swiss company and out again, and the paper trail was shredded in the days after the story broke.
The damage was constitutional rather than financial. Congress had legislated, the president's own staff had worked around the law, and the question the country argued about for the next year was what the president had known and when, which was never answered because nobody could prove it and because the paperwork that might have shown it had been destroyed. The paperwork was gone. The Tower Commission reported in February 1987, blamed the National Security Council staff, and said the president had not understood what was being done in his name.
Congressional hearings ran through the summer of 1987 and were televised, and North became a figure that people argued about rather than agreed on, and an independent counsel spent six years and tens of millions of dollars on prosecutions that produced a handful of convictions, two of which were overturned on appeal and one of which was pardoned by President George H. W. Bush in 1992. Reagan recovered. His own popularity went back up within a year, and nothing in the way the government was organised changed.