Do the math and you will see the benefit of discounting relative to default rate.
Of course these variables are linked, but it's not as simple as saying that a default rate of, for example, 10% means that the "fair" break-even discount is 10%.
To analyze why this is, first examine a perfect, simple world with no transaction costs, no opportunity costs, total loss on default, perfectly shared knowledge of risk, and only a single payment remaining. Then assume $100 payment due on any given note and a default rate of 10% for the note's current status. Then, the person selling the note would receive $100 (P=0.9) or $0 (P=0.1). With diversification, they would make $90 on average and it might appear reasonable that $90 is a fair market value for the note. But remember, this is a break-even value, and what buyer wants to risk their money for no possibility of greater return on average? The actual market value of a note in this situation is actually discounted more than the default risk!
How then, do notes regularly sell for less of a discount than would make sense?
Firstly, there is no perfectly shared knowledge of risk, and a note's risk isn't perfect knowledge to begin with because every note has a different real risk than the mean. Buyers who believe the note's risk is substantially less than the average will be disposed to value it higher. Many things can effect this perception, so I'm not getting into that.
On a more direct financial matter, the discount in this case is not off of YTM, but just P+I. There are more cashflows coming! So, a 10% discount on a $100 note on Folio that would have a total PV'd YTM value of $110 is actually more like a 18% discount in the context of comparing it to the default rate.
Then there are more minor factors like opportunity cost. A seller of the note gets their money immediately, but the money is no longer working for them. It may take them a couple of weeks to reinvest their money, and up to a couple of months to start getting cashflows from it again. Another factor is that default is not always a total loss, and recoveries are made in collections. Transaction costs cause a slight lowering of the discount as the seller tries to close their margin.