What happens if I don't want to keep the car or other collateral?

You can give it back or surrender it.  In this case the receipt of the collateral by the lender renders the debt an unsecured debt in the bankruptcy.  The creditor can sell the asset to recover part of the claim.  Even if the asset isn't worth what was owed on it, the unpaid balance is discharged in the bankruptcy.  Many people who purchased high end automobiles with high monthly payments are candidates for this remedy.