It’s VERY similar. From the borrower’s point of view a bond and a loan are both means to get money now and pay that money back, plus interest at a later date.
Historicly bonds were more tradable and sellable but in the past 20-25 years loans have become things that also get bought and sold. But technically speaking that’s the main difference.
A bond is issued by the company (borrower) and bought by the lender. The terms are set by the company and the lender eauther purchases the bond or does not. The bond can then be resold and traded without the permission of the original lender.
Where’s a loan is more like a contract to borrow money between 2 parties (the borrower and the lender). In modern times the lender can sell that contract but that’s a relatively new invention and normally needs to be specified within the contract that they have this right. Loans often have a lot of details in terms of milestones, that the company might need to maintain (called covenants) that are generally not present in a bond.
It’s also worth pointing out. Non-publicly listed companies can’t generally sell bonds because they don’t adhere to the same set of rules as public companies do in terms of disclosure and whatnot. But anyone can take out a loan as long as a lender is willing.