Lien and pledge are both based on the premise of possession of the subject matter, but the object of the lien is the subject matter of the main contract, for example, you commissioned me to process shoes, you failed to pay the time I have the right to lien the shoes and its exchange of money against the amount you owed you the money, but there is a main contract, namely, the commissioning contract, and the shoes are the subject matter of the main contract
Pledge is also a transfer of possession, but the subject matter of the contract and the main contract does not have any connection, is that you have to give me a certain amount of goods, money, or certificates of value to ensure performance. You give me something in kind, money, or a certificate of value to guarantee performance, and if you don't perform, I have the right to use it to satisfy my losses.