Distributors often partner directly with manufacturers as a dedicated distributor of a particular product or type of product. It's considered a business-to-business (B2B) relationship, and is often the first link in the supply chain after the manufacturer. Distributors may sell to retailers or wholesalers, but don't really sell to the public.
Wholesalers are similar to retailers in that they buy products from distributors and may sell directly to the public, but with a twist. Wholesalers generally buy in huge bulk from the distributor (products are also generally packaged in bulk), then sell to consumers in bulk. Wholesalers are both B2B and business-to-consumer (B2C). Sometimes they sell to retailers (B2B), and sometimes they sell directly to consumers, such as at warehouse clubs (B2C).
Why retailers matter to investors
Retailers are the backbone of many investment strategies. In fact, consumer staples are generally considered good hedges against downturns in the economic cycle, and retailers that focus on these areas can be good offsets to segments that struggle during these times, like many areas of the tech industry. However, retailers aren't good investments simply because they're retailers -- some are much better than others, and you should consider the consumer base and how the retailer markets itself, among other things.