The only thing that requires space related to Home Assistant is the database that records sensors and events.
And most of the traffic that spins a harddisk is data written to the disk. The Python code gets fetched from cache memory in multiple levels I am sure.
Home Assistant is a 24/7 software running time based events, sensor events, etc etc. Foreground vs backgroud makes little sense in this context.
The required diskspace is very small for the base Linux, the Python system and various addons. People run HA on quite small SD cards.
The issue with SD cards is if people have very small cards that do not have enough storage to allow wear levelling. And then the time it takes during heavy reading during boot and restart of HA.
On a raspberry pi you need to buy cards that are rated for I/O of many small files (A2 is the rating to look for) and buy a well known brand and a card that is much larger than you need so the primitive wear levelling on SD cards can move data around as data is written
When we talk external disk we mostly talk Raspberry Pi.
And you would not want to use a spinning hard drive. A small SSD like 64 or 128 GB with USB3 interface is more than enough and will fly as a rocket on a Rpi 4. You cannot boot from USB on Rpi 4 yet but it may be months, maybe weeks before we have that as well.
An SSD of that size does not consume much power, makes no noise, does not spin up and down. It is storage in the Terabyte class where spinning harddrives still make sense seen from price per gigabyte. But the size of drive you need for Home Assistant in a NUC or Raspi or virtual machine is so small that SSD is the only thing that makes sense.