A holder of record is the owner in the internal records of the company that is owned. Those records are usually maintained by a stock transfer agent. Due to the costs and the risks associated with being in possession of physical shares, most people own shares in book-entry form. These are also called "street name securities." The shareholder of record is the brokerage firm, bank, or trustee that the owner has an account with.
If party A is a Merril Lynch customer and sells 100 shares of ABC and the buyer happens to be a customer of Merril Lynch, then the holder of record does not change but the book-entry owner does change.
Although it is technically possible for anybody who is the holder of record to loan shares to anybody else, it isn't practical in any sense. It would require customized debt documents, practical collateralization methods, transfer fees and so forth.
However, owners of shares held in a margin account, as opposed to a cash account, automatically agree to allow their shares to be loaned out to others by the broker-dealer.
If you are the beneficial owner of shares at a brokerage in book entry form or if you are the owner of physical shares, you are the "real" owner. With that said, if a short seller borrowed the shares and sold them to you, then both you and the original owner are the true owner of the exact same shares.
If that original owner then decided to sell the shares, either the broker would need to find someone else to borrow shares from or the borrower would have to repay the shares. That is the reason for the short squeeze with GME shares. The small buyers were not selling their shares and some may have had cash accounts. Their individually small purchases were upsetting the applecart because they were adding demand while removing supply.
Securities are somewhat unique in that if you demand shares and buy them, then you become a supplier of shares. Likewise, once you sell shares, you may then become a later demander of the same shares.
An accounting issue does happen when more shares are claimed than exist. What happens when dividends are declared? Who gets them?
The practical solution is that brokers require short sellers to make up all lost dividends to borrowers. Plus, since dividends are taxed at a different rate than interest, they must pony up the tax money for the new owner so they can pay the additional amount to the IRS.
As a result, if you hold shares at a broker, you may receive interest in lieu of dividends in an amount marked up to cover the highest tax rate. If you are not a high income person, then you may make an additional profit.
The holder of record is the legal owner of the shares. Shares held in street name are the beneficial owners but hold a legal claim to them via their account agreement. Instead, their ownership record appears as a notation on the broker-dealer's internal bookkeeping records.