Difference between ways of rooting device
In my understanding, the end result is the same in both cases, it's just the rooting methods that differ. Some devices have vulnerabilities that can be exploited in order to push the su binary to the device via adb (example), but these do not exist in all devices. This is why flashing is required sometimes.

TL;DR: It depends on your device.