What happens if collateral on a loan is destroyed, and you then fail to pay back the loan?

For example, if you owned a factory, and you secured a loan with equipment as collateral. But the equipment was destroyed in a fire. What happens if you then fail to repay the loan? Is the bank out of luck? (Assuming there was no insurance on the equipment)?

Additionally, suppose there was a fire insurance policy taken out on the entire factory. Would the bank be able to tap into the proceeds of the fire insurance policy to pay back the loan?