The timing of when charges are filed has no legal relationship to when the alleged offense occurred. Prosecutors can file charges days, months, or even years after an incident as long as the statute of limitations for that specific offense has not expired. No rule says everything connected to a period of time has to be charged at once or charged immediately.
What drives a new charge coming after the fact is almost always an affidavit from a law enforcement officer swearing that probable cause exists to believe the offense occurred. That affidavit is the legal mechanism that initiates the charging process. A judge reviews it and either approves the filing or does not. The bar for that approval is probable cause, which is a relatively low standard, not proof beyond a reasonable doubt. That is why it is said that a grand jury would indict a ham sandwich if the prosecutor asked them to. Getting charged is not the same as being convicted.
The statute of limitations is the practical protection against charges from the distant past. For most felonies the window is several years, and for some serious offenses like murder there is no statute of limitations at all. If the alleged conduct falls within that window, the timing of the charge relative to any incarceration is legally irrelevant.
What matters now is the evidence behind the affidavit, the strength of that evidence, and what defenses are available. A charge filed on a weak affidavit still has to survive the scrutiny of a defense attorney and ultimately a jury if it goes to trial. Getting charged is the beginning of a process, not the end of one.
An attorney needs to review the charging documents and the affidavit immediately.