matyas_is_taken wrote:
...Can installing programs like homebrew leave files behind when resetting the macbook to factory settings. Can some programs get installed too deep into macOS that the mac doesn't delete them during a reset?
The user @neuroanatomist is technically correct. Rotational HDDs can retain a magnetic imprint of data unless zero'd out. Disk Utility can do that, though it is time consuming. Someone with a specialized app may be able to recover that data. SSDs are functionally different and don't retain data after being wiped.
However, as to your third question - can some programs get installed too deep...? - no. Apps and files don't get installed in places that are safe from erasure. When either type of drive is properly erased, everything gets removed. All of the directories and indexes that tell a computer where files are stored get deleted.