The version of DX12 on the XSX is a low level API though. Heck, that was the entire point of DX12 in the first place, to compete with GNM on the PS4.
www.anandtech.com
Read about DirectX 12, a low-level programming API from Microsoft that reduces driver overhead in comparison to its predecessors. DirectX 12 provides more flexibility and fine-grained control on the…
developer.nvidia.com
It's also the reason DX12 has been such a hit and miss on the PC side of things, your game engine has to specifically coded to work well with it. Hence some games saw massive games (on AMD hardware) and others saw very little or actually regressed in performance.
Now it may very well be the PS5 API has a lower overhead then the DX12 version on the XSX, but it likely isn't anything huge as both are effectively using low-level APIs. Both consoles will continue to get performance enhancements as the lifecycle of both consoles go on, we even have a recent example of this, Control was improved on both consoles with zero input from the developer.