The malware itself is non-persistent and doesn’t survive rebooting (typically, it would be installed in /tmp, which is a RAM file system). To survive a reboot, a piece of malware would have to somehow break the chain-of-trust extending from the boot loader (since everything is effectively revalidated on boot), which is a much smaller attack surface that is much harder to exploit.
Apple is not intentionally removing malware themselves, and AFAIK they don’t have the ability to tell if a device has been compromised.