Short-selling and securities lending
For retail investors, the most common place that securities lending comes into play is with short-selling. In short-selling, the name of the game is to sell an asset for a bunch of money, then quickly buy it back for a lot less, pocketing the difference. It can be difficult to find enough shares that are for sale to do this with, and sometimes it's just a big headache to collect them, so short-sellers often borrow securities instead of buying them.
When they borrow these securities, like your shares of XYZ, Inc., they're responsible for paying you for the privilege. You may get a little interest or some other kind of consideration, but there is a real risk that your securities will not come back to you, which is why it's still a risky investment move. If you're working with a reputable brokerage, however, your value should be returned even if the actual asset isn't, since they generally require a large amount of collateral to be put down by the short-sellers who will be borrowing your stocks.