The due-on-sale clause is a right the lender holds, not something that fires automatically. When a property transfers while the loan stays in place, the lender may accelerate, meaning demand the full balance. May is the operative word, and whether a particular lender would in a particular situation is a question for a real estate attorney in that state, because both the loan language and the remedies available differ.
Why people still do it: the clause gives the lender an option, and lenders have historically been slow to use it against loans that are performing and paying on time. Nothing guarantees that. A lender that does accelerate isn't necessarily foreclosing the next day either. The usual path is a demand letter, and the seller then has to pay off the underlying, which in practice means the buyer refinances or the parties sell. That's why wraps are typically written with a plan for that scenario built in, often a refinance window for the buyer.
Who carries the risk is the part your question gets right. The seller stays personally liable on the underlying note. If the balance is called and the buyer can't refinance, the seller has a problem the buyer didn't sign for.
What you haven't hit yet is insurance. When the property transfers, the hazard policy has to change to name the new owner, and the senior lender is listed as mortgagee on that policy and often gets notified of changes. Sellers who don't think this through either leave a policy in the wrong name, which can void coverage on a claim, or trigger the notice they were hoping to avoid. Work that out with the insurance agent before closing rather than after.