Although usage of bills of lading can be traced back to Roman times in the first century AD, the modern bill of lading did not come into use until mediaeval times. Prior to that, merchants used to travel with their merchandise and no such document was really required.
The initial function of a bill of lading was to serve as a receipt by the shipper for the goods, i.e. evidencing that the goods had been placed on board the vessel.
As time progressed, bills of lading acquired a second function, that of acting as a contract of carriage. However, the detailed contractual clauses that we are used to today only came into common use in the 19th century.
The third functionality, as a document of title, appears to have been first recognised in 1787, in an English court case wherein the court decided that the delivery of a bill of lading was a delivery of the goods themselves. In fact, a court case in 1870 described bills of lading as keys to the warehouse.