As noted by MacRumors, Apple has released new firmware for the Lightning and USB-C versions of the AirPods Pro. It includes support for the new features in iOS 18 for the wearables.
Installation on the AirPods Pro 2 is automatic when the AirPods are in their charging case, the case is plugged into a charger, and the linked iPhone is in close proximity and connected to Wi-Fi. You can check the installed firmware revision in the “General” settings menu, by selecting “About,” then “AirPods.”