https://www.investopedia.com/terms/f/fractionalshare.asp explains that fractional shares can be naturally-occurring, but I want to talk about artificial fractional shares in “normal” stocks.
Custom baskets are traded as equity-swaps. Client specify a weightage profile of the basket like x% IBM + y% AAPL + z% GE where x+y+z ==100. The sell-side dealer (not a broker) would hold the positions on its own book, but on behalf of clients.
Such a basket is not listed on any exchange (unlike ETFs). If client were to go long such a basket directly, due to limited liquidity on some constituent stocks she may not get the desired weightage. In contrast, a sell-side has more liquidity access including smart-order-routers and internal execution.
The weightage means some stocks will have fractional quantities in a given basket. Also such a basket could be too big in dollar amount like $58,476, so the sell-side often use a divisor (like 584) to create a unit price of $100, similar to a share’s price in a mutual fund. Fractional quantities are even more inevitable in one unit or in 391 units.
After a client buys 391 units she could sell partially.
With mutual funds, I often buy fractional units as well, like 391.52 units.