Those are profitable because the vast majority of roadside assistance customers will never need roadside assistance; those customers fund the ones who do need a tire changed or a jump start or a tow. You can assume that pretty much everyone will need to see their doctor.
Yes, everyone will need medical care of one kind or another eventually.
I think far more people than you anticipate will need roadside assistance. When that happens, and your car is smoking on the side of the road, you have zero negotiating leverage with the tow driver. If they want to charge you $500 to tow you to the nearest garage (which they may well own) you have little choice but to pay. (Of course in the era of cell phones, you can now just start dialing for alternatives. If you have service. Depends on where you drive. And AAA ain't what is used to be.)
On the other hand, an organization like AAA can solicit one of many providers in a given area, and say "We will refer you ALL of our members who need service in this defined territory -- and our data says will average (e.g.) 35 calls per year -- if you agree to charge them no more than this menu of prices/services. Will you take that deal?" Some may even compete for that position, and pay a fee to AAA. Then AAA turns around and market that 'insurance' to drivers for an annual fee.
Not understanding the parallel with Costco here... my Costco membership in and of itself gets me nothing other than through the door of a Costco store.
Costco members pay a fee for access to products at prices it negotiates. They lean hard on producers', particularly targeting high-markup items (Like Optical! Just keeping it on-topic!
). They drive pricing down and put a low and relatively flat markup on their products, which they can afford because they also have membership revenue coming in.
In my case, despite being a cash customer (no collection costs; no overhead salaries for coding and billing and paperwork via insurance claims), I was charged $1000 for an emergency tooth extraction. When all was said and done, the insurance company had negotiated that same service down to the $600 range, and that required all the overhead costs I mentioned. Being a 'member' of that insurance plan saved me $400. That negotiating service alone is worth a fee. In addition to that, medical insurers do the actuarial business of pooling money for extraordinary expenses. The latter starts to break down because, as we agree, everyone will need medical care of one kind or another eventually.
I simply bring it up to throw a wet blanket on the whole "insurance companies are nothing but scummy leeches" populist clap trap. In my case, in that situation, the leech was the medical provider. Oh, and the Human Refuse department -- don't forget them.