They need to differentiate, but given Samsung's clearly lackluster track record at OSes, it's obvious they're very bad at software and they know it.
Plus their Android flavor (One UI) is extremely underperforming, even when compared to the Chinese OEMs. If we compared it against the cleanliness of Pixel software, you'd inmediately see Google is simply much, much better than Samsung at software even with the same foundations.