I’m not exactly sure how they make money as the prices are often nearly identical.
It worked well for several years with millions in sales, all automated. It became untenable though as Cryptocurrency facilitated people buying Amazon gift cards with stolen credit cards and cashing them out at 30-50% of face value.
So the market became saturated with scammers selling considerably cheaper than Amazon. For a time maybe 6-4 years ago you could get pretty much anything from Amazon on eBay for around 20% less and shipped direct from Amazon via prime.
Amazon eventually shut it down though and if you meet some very strict gift card threshold they will just steal your balance. People still do it, but large scale automation isn't really worth it any longer.