Per Lord Diplock in Castle Ins Co v Hong Kong Islands Shipping Co  AC 226 at p.234:
The lien attaches to the preserved cargo at the time when the sacrifice is made or the liability to the expenditure incurred. The lien is a possessory lien and it is the duty of the master of the vessel to exercise the lien at the time of discharge of the preserved cargo in such a way as will provide equivalent security for contributions towards general average sacrifices made or expenditure incurred not only by those concerned in the ship but also by those concerned in cargo in respect of which a net general average loss has been sustained.
The lien, being a possessory one and not a maritime lien, is exercisable only against the consignee, but it is exercisable whether or not the consignee was owner of the consignment at the time of the general average sacrifice or expenditure that gave rise to the lien: a fact of which the shipowner may well be unaware. At the time of discharge the sum for which the lien is security (save in the simplest cases, which do not include that of a general ship) is unquantifiable until after there has been an average adjustment. Indeed in the case of some consignees of cargo that has been preserved in part only or damaged in consequence of a general average loss, so far from being liable to a net general average contribution they may eventually turn out to be entitled to a net payment in general average.
…In practice what happens is what happened in the instant case; the master, acting on behalf of the shipowner and of any persons interested in cargo who will be found on the adjustment to be entitled to a net general average payment, releases the preserved cargo to the consignees upon the execution by each consignee of an average bond in one or other of Lloyd’s standard forms accompanied, in the comparatively rare cases of cargo that is uninsured or underinsured, by a deposit in a bank in joint names of money as security or, more usually, by a letter of guarantee from the insurer of the cargo.