MacBooks with a T2 Security Chip have their microphones disabled when the lid is closed. Now the iPad Pro models released this year have the same feature, an Apple support guide mentions.
This capability can be found on the 13-inch MacBook Pro and MacBook Air models with the T2 chip, as well as the 15-inch MacBook Pro from 2019 and later. Although Apple makes no mention of the iPad Pro having the T2 chip, the microphone can still be disabled.
iPad models beginning in 2020 also feature the hardware microphone disconnect. When an MFI compliant case (including those sold by Apple) is attached to the iPad and closed, the microphone is disconnected in hardware, preventing microphone audio data being made available to any software—even with root or kernel privileges in iPadOS or in case the firmware is compromised.
This can be seen as a both a privacy and security feature, since even if your iPad Pro is compromised by malware, it can’t spy on you, at least under specific circumstances.