There is a very active market for "repo" loans, where "repo" is short for "repurchase agreement", and what are understood to be collateralized loans are structured as sales with an agreement to repurchase. If I have a bond worth $1020, and I sell it to you for $1000 today while simultaneously agreeing to buy it back from you at $1001 in one month, I am effectively borrowing $1000 at an interest rate of .1% per month; if I go bankrupt or otherwise fail to pay you back, you have the bond, and even if the value of the bond has dropped, as long as it drops less than about 2%, you're not losing any money. Similarly, you may have cash that you want to put somewhere safe with a little bit of interest for a short period of time, and go looking for that transaction; if you're initiating it, perhaps you have to lend a bit more (perhaps more than $1020) against the bond to protect the other party against your default, or perhaps you find someone looking to borrow and willing to overcollateralize the loan as usual. The terms are somewhat malleable.
Another reason for participating in the repo market is that, rather than trying to move cash onto or off of your balance sheet, you have a bond that you want to move onto or off of your balance sheet; instead of looking to borrow or lend cash, you want to borrow or lend the bond, which is just the flip-side of the same transaction. It may be possible for you to safely invest money at a (slightly) higher interest rate than you can borrow in the general repo market, but it is more often the case that particular bonds will enable you to borrow at an even cheaper rate, possibly even negative — you sell the bond for $1000 with an agreement to repurchase it for $999 a month from now. When this is the case, it is generally because some other market participants want to borrow that particular security, and are willing to pay a premium to do so. If general interest rates are .1% per month, a repurchase agreement at -.1% per month is perhaps best viewed as a loan of the security, secured by cash, with a $2 fee for borrowing the bond for a month. In fact, it is likely that you would take the $1000 and turn around and lend it back into the repo market for that .1% per month rate, on net swapping a "special" security for a "general" one on your balance sheet now, but with agreements in place to let you swap them back in a month while clearing $2 in the process.
The reason one would want to borrow a security (and would be willing to pay a lending fee — or, in some sense, to forego interest on money one is lending out — in order to do so) is sometimes that one has contractual obligations for some reason to deliver a particular security to some other party (as, for example, if I had written a call option on the bond, and it has been exercised), but most often (I believe) it is because the person looking to borrow it expects it to go down in price (or is afraid it will, and is looking to hedge the risk). In this case, after you (formally) sell them the bond, they will sell it again; if you sell it at $1000 with an agreement to buy it back at $999 a month from now, and they sell it for $1000, but can buy it back at $998 a month from now, they clear a profit on the trade. (Again, this may be intended to offset a loss that they expect to incur somewhere else in the case that the price does go down; whether they're making an affirmative bet on a drop in the price or hedging an existing risk doesn't make much difference here.) In this case it seems to me that it would be more natural not to buy the bond in the first place; what they really want is the agreement to sell the bond for $999 in one month, and this is the easiest way to do that.
Up to this point I've been using a pretty plain loan structure for purposes of illustration, but repo loans (and other security loans) are often done differently. A typical example would be that we agree on an interest rate for the loan, but not on a fixed maturity; it goes until one of us decides to terminate it, subject to a reasonable notification period, after which we close it out. The "forward contract" now looks a little bit stranger as a forward contract, but not especially strange: the price at which it will be executed changes over time, quite possibly in a linear fashion (e.g. by 3 cents per day), and (as with the loan) will be executed at some point in the future, after one of us notifies the other that we wish to close it out. If we decide that a haircut is appropriate, one of us may post collateral (e.g. $20) with the other.
I'm curious as to why there isn't a developed market for these agreements absent the repo market. The answer that seems most likely to me is that the repo market serves the money lending and borrowing function that it serves, and is quite liquid; one market for lending and borrowing and another for forward contracts with a separation between the two would presumably make both markets less liquid than they can be if they're combined. Another possibility is related to the fact that if I borrow a security from you so that I can sell it, I'm not selling it back to you; the net result to me is the same as if I managed to enter into a forward contract with you, but I'm also intermediating the sale of the bond from you to someone else. The economic exposures are similar to what would result if I had entered the forward agreement with the someone else instead of with you — we could just cut you out of this — but I wonder whether there are important reasons why people looking to buy a bond want to buy the bond, rather than enter a forward contract to buy it, while people who want to hold a bond are willing to enter such a forward contract while simultaneously selling it. A possible reason for this would be related to custodial practices; in particular, retail investors may not be able to enter such forward agreements, but their brokers may be able to "lend out" securities held on their behalf (subject to various safeguards), so that the party that is institutionally capable of entering the buy side of the forward contract is also institutionally required to maintain a net zero exposure while doing so.