All Mac portables with the Apple T2 Security Chip feature a hardware disconnect that ensures the microphone is disabled whenever the lid is closed. On the 13-inch MacBook Pro and MacBook Air computers with the T2 chip, and on the 15-inch MacBook Pro portables from 2019 or later, this disconnect is implemented in hardware alone. The disconnect prevents any software — even with root or kernel privileges in macOS, and even the software on the T2 chip — from engaging the microphone when the lid is closed. (The camera is not disconnected in hardware, because its field of view is completely obstructed with the lid closed.)
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.
That first paragraph above is not new; the second paragraph obviously is. This is what it looks like when a company is focused on security as an utmost priority. (Via DJ Capelis.)