These bring an obvious benefit to the company running the program, they retain more loyal customers. When the first company in a sector introduces a loyalty program then they take some customers off their competitors. But there is no great secret to a loyalty scheme and it is easy for other companies in the sector to copy the idea and introduce their own program.
When they do this they will take some customers back and it everyone is pretty much back to where they started but with the additional cost of running a loyalty program. This is a lose-lose game for everyone.
But is it really lose-lose? There is now something extra in the situation that it is easy to miss. Now each company has customers that are more loyal than they were before because they have them tied into a loyalty program. This means that they can use that loyalty to charge higher prices than they could before the introduction of the loyalty schemes. There is less incentive for anyone to start a price war because it will be harder to capture loyal customers from their competitors.
Loyalty programs have really given a situation where the companies have more loyal customers, so they can charge higher prices and have less cost associated with finding new customers.
This is a hidden win-win game in what at first looks like a lose-lose game.