This was true up till the iPhone 14 Pro or 15 Pro. Since these generations, the phone (and iPads) can run off of wall power completely - not touching the battery.
iOS 26's battery does a better job of showing this than 18 did.
Note, 2.5 hours of screen active time, 2 hours 20 mins of idle - 0% battery used. Because it spent all day being plugged in.
View attachment 2563405
How it looked on iOS 18:
Note 0% battery used despite 4.5 hours of screen on time on that Saturday - because it was plugged in. Previous days - despite 6+ hours of screen on time, tiny bit of battery used because it was plugged in most of the time.
View attachment 2563409
If I leave it plugged in, it won't use any battery despite tons of screen on time ( see below ):
View attachment 2563406
Perks of a desk job (personal health fails tho). lol.
One reason why my 15 Pro Max has 196 cycles despite a fair amount of use (I've read several 600+ page books on it).