TD Ameritrade typically loans the shares to third parties (brokers, traders, hedge funds) for a fee, which is then shared with clients in a 50/50 split.