Why would Amazon invest its profits in cancer research? Wouldn't you expect a drug or biotechnology company to invest their profits in cancer research?
Amazon is in the business of creating a marketplace that efficiently matches buyers and sellers. It provides a distribution infrastructure for sellers and provides a high level of service for buyers.
Last time I heard Amazon is struggling with net positive cash flow because it keeps on re-investing profits into various other side projects with eventual goal of dominating retail space e.g. Amazon Go.