This classic question comes up every time a company comes at a crossroad where options are either to build an expertise or buy it from the experts. The short answer is: build it if it is your core competency, buy in all other cases.
If your core competency is to sell detergent, build the product and sales & marketing machinery, buy the services to support it. You don’t have to build a data center to store information, you can buy it. You don’t have to build data analytics machinery to understand this information, you can buy it. Let the system engineers and data scientist respectively at expert shops do that while you focus on selling your detergent.
Buying has a lot of advantages. It keeps your overheads under control. You are relying on someone whose entire job is to sell that particular thing. What you would otherwise build as your back office is their front office. They stay on top of things. In areas like technology where machine learning, new technology deployment and product evolution happens at a rapid pace, the service provider will distribute the cost among several buyers making it so much more cost-effective for you along with making to get the latest and greatest stuff without worrying about the details under the hood. When you are buying, in most cases you are options, i.e. there’s competition among the sellers, which always work in your best interest.
So long story short, you got to buy it if it is not what you do. Focus on what you do and do it the best it can be done. Buy the rest.