The Apple Watch hardware is otherwise the same. The back of the watch shines light of a specific wavelength into your skin and measures the reflected light. Heart rate sensing uses green (525 nm) and infrared (850–940 nm) light; blood oxygen sensing added a red light at 660 nm in 2020.
The iPhone will now calculate the ratio of absorbed red to infrared light, then apply calibration constants from experimental data to estimate blood oxygen saturation.
More detailed writeup on how the technology works is here: https://www.empirical.health/metrics/oxygen/
Masimo does have patents on specific implementations of pulse oximetry and sued Apple for implementing specific patented features. This made their legal case pretty solid, but it also made it possible for Apple to continue providing pulse oximetry as long as they avoided the specific IP owned by Masimo.
I’m curious why this isn’t settled. Apple has surely floated an offer, and it would appear that Apple isn’t going to budge on this. Were I in charge at Massimo, I’d think some money is better than no money.