> Let’s say hypothetically that the company does not have a work issued laptop and that the company has invited developers to the organization with their personal github accounts.
If you care about the privacy of your code, that's not how you do it. You'd have your own private gitlab instance (or github enterprise, if paying LOTS is your thing) with company-specific accounts, likely tied to your Active Directory or so.
And as others have said, treat your employees fairly, pay them well, educate them about code ownership, private data and so on.