Interactive Brokers first search for shares within their own customer holdings and if none there, they have connections with other institutions to obtain shares from them.
I place about 60% of my fully paid shares available to IB lending for shorts, in return I receive a small percentage return daily not a huge amount but covers all my other trading costs data feeds, brokerage,slippage etc