You probably have conversation awareness on, so only when you talk the AirPods switch to Transparency mode. Otherwise they are always in ANC (Noise Cancellation). To turn it off you can either long press on the sound/AirPods slider in the control center while you have your AirPods on and they are connected. Then you can press and toggle the Conversation awareness off. Or when the AirPods are connected you can go into settings and into the AirPods settings and turn it off.
Alternatively, you can also open the settings window with the i in bluetooth. Here is a link that explains it. Only the first part is the important part for you: Change the settings of your AirPods and AirPods Pro - Apple Support