A customer came in last week with an iPhone 12 that rebooted every time the phone vibrated.
If your iPhone reboots randomly once a month, it might be software. If it reboots once an hour, it is almost certainly hardware. The Panic Log Analyzer tells you which hardware.