You buy things from their website and pay using their payment platform. The website doesn't make it obvious that you're actually buying from a third party ("sold by: X" is in small letters and gets lost between all the other details). And Amazon lump items from different vendors together in the same product page.
I literally bought like 3 items on Amazon before realizing that not all items were sold by Amazon themselves.
When it turns out that items are counterfeit, they try to offload a great part of their responsibility onto the legal system, because they see themselves as the victims of counterfeit, not as facilitators [1]. Luckily, some judges are not buying their excuse [2].
(Even if buy items "sold by Amazon", you can get a counterfeit product [3].)
[1] https://www.aboutamazon.com/news/company-news/amazon-establi...
[2] https://californiaglobe.com/section-2/amazon-liable-for-defe...
HN discussion: https://news.ycombinator.com/item?id=24174276