There used to be a Sam's club 1 mile from my house (closed several years ago when Sam's consolidated operations and eliminated under-performing stores). I would go there even though I have quite a bit of COST stock (done really well over the years). My buddy would give me a hard time for shopping at the competitor of a company I have a sizeable investment in.
Many people have already addressed the differences. I would argue with my buddy that the quality of products is not much different. I would tell him Dole, Del Monte, Charmin, Samsung, Tide, Bounty, Tropicana, Coke etc did not make one set of products for Costco and one for Sams. But I do agree for the prepared foods, Costco is much better quality.
My main reason for shopping Sams over Costco (even though my sizeable investment in COST), was the convenience. There are 3 Costco within a 5 mile radius of me. However, they were always very busy. Even during mid-week daytime hours. Sams I found to be much less busy when compared to Costco. Of course Sams would be busy on the weekend, but their busy did not equate to Costco busy.
What I appreciate about Costco is the attitude off the employees. They are more friendly, more helpful and happier to serve you. The employees at Sams were glorified Walmart employees (same company) and they seemed miserable for the most part. There were friendly Sams employees, but the overall "feel" was much different.
If you have been to In N Out burger and then compare the employees there with other burger chains, you will understand what I mean. Both Costco and In N Out are more selective in their hiring process and expect more from their employees in terms of attitude and service.