I heard about persistent reverse shells, and how in theory, they can stay indefinitely on the target's system, and how they can connect back to the host when the target's machine boots up, but how do reverse shells gain their persistence? Do they copy themselves to the Windows Startup folder, is there an external script which runs the program, or do write to a process?
A reverse shell is just a technique to connect to and control a computer. On its own, a reverse shell has absolutely no persistence capabilities. In order to persist, it must be the payload of malware which does offer persistence. For example, malicious software set to run as a service could install a reverse shell.
There are numerous ways this can occur and these differ depending on your stack. Unfortunately there are too many to go through here - BUT what I would suggest if you are interested in this sort of thing (and it is extremely interesting) is that you go the the Mitre ATT&CK site and look over the category marked persistence for practical examples.
The short of it is things like tasks or applications that run quite often can have certain flaws in them that will allow malicious code to be executed giving persistence. Why on windows you can use WMI events to maintain persistence every time the user opens chrome if you want.