When the tax was enacted, Amazon didn't. NY didn't like the fact that because Amazon didn't have nexus in NY, they were exempt from collecting NY sales tax. So they changed the sales tax law and wrote it in such a way that Amazon would become subject to collecting and remitting NY sales tax. Hence the law was called the Amazon law because it was written specifically to go after Amazon. The change made it so that "marketing affiliates" would count towards creating nexus, so if an Amazon banner ad appeared on any website that was based in NY, that made Amazon subject to NY sales tax.That is because Amazon has a physical presence in NY.
Of course, this only applies to items sold by Amazon, so if you order anything on Amazon sold by an Amazon marketplace seller not located in NY, even if it was fulfilled by Amazon, no NY sales tax is collected.