There are two main types of contract which are in wide use when we speak about transportation of goods by sea: a charterparty contract and a bill of lading contract. Speaking of bill of lading contract, however, one shall bear in mind that in some cases the bill of lading can be no more than a receipt for goods loaded on board, in some it may serve as an evidence to the charterparty contract and, finally, it imposes contractual obligations for safe custody of the cargo on the carrier before the person taking delivery of the goods.
Moss and Others v Smith and Another  EngR 155; (1850) 9 CB 94; 137 E.R. 827 per Mr. Justice Cresswell at pp.105-106:
What is the nature of the contract between the ship-owner and the merchant whose goods he contracts to carry on freight! The ship-owner engages to carry the goods from the port of loading to the port of discharge: his contract would be absolute, but for the exception introduced into the bill of lading, – unless prevented by perils of the sea. Now, when is the ship-owner said to be prevented by perils of the sea from fulfilling the contract he has entered into? When the ship is, by peril of the sea, rendered incapable of performing the voyage. A ship is not rendered incapable of performing the voyage when she is merely damaged to an extent which renders some repairs necessary: if that were so, any the most considerable damage, such as the loss of her rudder, without which she could not proceed,: would render her incapable of fulfilling the contract contained in the bill of lading. But, if a ship sustains so much sea-damage that she cannot be repaired, so as to be rendered competent to continue the adventure, then the owner is prevented by a peril of the sea from fulfilling his contract. If the ship is totally destroyed or sunk, the performance of the contract is obviously prevented by a peril of the sea. The courts of law have also engrafted this qualification upon the contract, – that, if the damage which results from a peril of the sea, is so great that it cannot be repaired at all, or only at a cost so ruinously large that no prudent owner would undertake the repairs, the owner may treat the loss as total, and say that he is prevented by a peril of the sea from performing his contract.