They would have never used the exact same battery, since the batteries would have been designed to Apple’s specs specifically for a particular model of iPhone (and similarly Samsung’s batteries are designed specifically to their device specs). SMART lithium batteries have to be designed to match the power requirements of the device they’re being installed into.
Apple (and Samsung, and Nokia, and LG, etc) all source many components from the same companies (displays, batteries, RAM, solid state storage modules, cellular radios, wifi radios, BT radios, etc). But that doesn’t mean that their supply of some of those items is not specific to their own internal design specs (or flashed with Apple specific firmware).
Think about RAM - all the worlds RAM, regardless of how it’s branded and packaged, is made by a mere handful of companies. And Samsung, Micron (Crucial) and Hynix pretty much make by far the majority of it all (Samsung and Hynix alone account for about 60%-65% of the global RAM market). So everybody, from Apple, to Dell, to Lenovo, to Nokia, to LG and so forth are likely all sourcing RAM from the same sources.