An external hard drive or SDD can be very useful with a Mac that has a low-capacity internal drive. Some Mac laptop users routinely keep an external drive plugged in, and they may have encountered a problem with unmounting that can be easily solved with sleep settings found in the Energy Saver or Battery preference pane (depending on your version of macOS).
If your drive has its own power adapter that plugs into an AC outlet, you almost certainly haven’t encountered this situation with either a laptop or desktop Mac. The AC power keeps the drive running even when your Mac goes to sleep.
However, if you’re using a bus-powered drive—one that gets its juice from a USB or Thunderbolt 3 port of your Mac, or a connected hub—you can wind up with settings that power down the drive and thus unmount it without proper safeguards.