There are an infinite number of shades of grey between “slap brand on an OEM product” and “the full Apple”. Companies often shift their approach (in both directions!) over time, and it will vary for different product lines.
https://www.nytimes.com/2016/12/29/technology/iphone-china-a...
It sounds like you think that Foxconn develop a new iPhone then Apple turn up to buy them like a consumer!
Foxconn manufacture iPhones under a precise contract with Apple, who do the design and plan how they should be built. Apple don’t just purchase them off the shelf.
You cant talk about samsung as a single company.
Apple tells Foxconn how, what, when etc to assemble often using equipment that Apple owns. So the only thing Samsung has over Apple is that they employ those people. And what value is that adding ?