In the last two months, dozens of savings and loan associations and municipalities have lost more than $500 million as a result of trading with two small government securities firms that failed: E.S.M. Government Securities Inc., of Fort Lauderdale, Fla., and Bevill, Bresler & Schulman Inc., of Livingston, N.J.

In most cases, these institutions engaged in either repurchase agreements or reverse repurchase agreements. In some cases, they were doing both kinds of transactions with the government securities firms.

Although the transactions sound esoteric -- and there are complicated versions of them -- fundamentally, they are nothing more than short-term, secured loans.

For example, a bank that makes a car loan puts a lien on the automobile for the duration of the loan. If the borrower defaults on the loan, the bank can reposses the car and sell it.

Similarly, the borrower in a government securities transaction puts up U.S. Treasury securities as collateral. If the borrower defaults, the lender can sell the securities. The District of Columbia, which did business with Bevill, Bresler and has done business with E.S.M., did just that with $10 million of securities it held as collateral for a loan it made to the failed New Jersey firm.

The savings and loans and municipalities that lost large amounts of money in the failures allowed the collateral to remain with the dealers, rather than demanding delivery of collateral to their own control. The Securities and Exchange Commission has alleged that the customers' securities were used by the failed firm to cover their own losses.

"Repurchase agreements and reverse repurchase agreements are the safest investment you can make, provided you make sure you have control of the collateral," said a top bank official.

The terms "repurchase agreement" and "reverse repurchase agreement" describe different sides of the same transaction.

In a repurchase agreement, an investor who wants cash temporarily "sells" government securities to a lender and agrees to "repurchase" them -- that is, pay off the loan -- on a specified date. In a reverse repurchase agreement, the investor with cash temporarily buys the securities and agrees to sell them back. The cash lender gets a specified interest rate.

A wide variety of institutions engage in repurchase and reverse repurchase transactions for a number of reasons.

Banks, which regularly raise billions of dollars in funds in the open market every day, use the government securities in their portfolio to raise some of those funds. Repurchase agreements "are the least costly source of market financing for commercial banks" because the financing is secured, according to Douglas Ledwith, chief financial officer of American Security Bank. Funds raised with repurchase agreements are cheaper than other sources of market funds such as federal funds or certificates of deposit. They are not cheaper than traditional bank deposits such as checking and savings accounts.

Investors who want to make safe investments secured by government securities regularly engage in reverse repurchase agreements.

Institutions -- including securities dealers -- use repurchase agreements to finance the securities they buy. The investors can buy the Treasury securities, then immediately use them as the basis for a repurchase agreement. If the investor manages the deal properly, the interest rate on the loan is less than the interest returned by the securities. "If I can borrow at 8.5 percent to finance 10.5 percent Treasury bonds, I make a profit," a dealer said.

Some institutions might make repurchase agreements using low-yielding securities they purchased years ago to come up with cash they use to make higher-yielding investments. Those investments generally have to be riskier than the government securities they use to collateralize the repurchase agreements.