Unfortunately, articles like this one never mention the research and development (R&D) costs required to engineer and release a phone. The costs of the equipment and software required to design such a device, as well as the cost of prototyping and testing said device can run in the billions of dollars. Once you add the expense of paying employees (and third-party companies) to design, test, build, package, market, package, and ship the phone, Samsung is most likely not making nearly as much profit as this article suggests.
This is a little bit of an oversimplified analysis... Component costs may have only increased by $40, but we do not have visibility of R&D, Engineering, and Testing costs. These can be quite expensive!
According to Tech Insights, Samsung's new flagship, the Galaxy S10+, cost US$420 to build. That represents a US$40 increase over the manufacturing cost of last year's S9+, while the devices' MSRPs show a massive US$160 differential.