They seem really big on keeping iOS things secret-ish, but the XNU kernel for both iOS and macOS seem to be built from the same code base.
Up until a couple years ago, they'd strip out ARM specific things from the releases macOS XNU code. Then they started leaving that stuff in!
What about their embedded OS? Like one they're running on T2 chip or inside Airpods? Is it still based on XNU kernel?
I would be surprised if that was the case. Low-power micro-controllers, such as ARM's Cortex-M series usually do not have support for virtual memory, which is required for running XNU.
They use L4 in the Secure Enclave. Perhaps they do the same for other embedded devices
T2 is a variant of A10 and runs XNU for the main CPU.
Firmware cores and AirPods run Apple RTKit.
IIRC they share the exact same kernel, so they don't need to.
They’re not quite the same, which is why the lack of iOS sources was a minor annoyance for a while.