Costco and Sam's Club have been duking it out in the wholesale market. Here's how their rivalry began and later intensified.