Your senior developer resigns. They have a 30 day notice period. On the last day, IT removes their GitHub access, HR collects the laptop, and they sign an exit form saying they hold no company code.
Over three years, though, they copied the repository many times. On the office laptop. On a home computer, to fix a bug over a weekend. In a personal GitHub account, to try an idea. In a zip file mailed to themselves before a trip.
Removing access on the last day stops new copies. It does nothing about the old ones. Usually nothing bad happens, because developers keep code since it is useful, not because they plan to misuse it. The problem is that you cannot know where the copies are, or what happens to them later.

