It's actually impossible to say with total accuracy what will happen to a deserter or absent member upon return to military control. In the civilian world, in most jurisdictions, the District Attorney (DA) decides what happens when a person is accused of a crime. In the military, that decision is made by the individual commanding officer. The commander decides how to process desertion and absentee cases after examining all the circumstances of the case, speaking with the accused, and conferring with his/her senior advisors and the JAG (Judge Advocate General) office.
The commander has many options to choose from. The commander could impose Article 15 (nonjudicial punishment), possibly imposing a fine, or restriction, or correctional custody, or reduction in rank, and then allow the member to return to duty. The commander could impose an administrative discharge, usually with either a general or other-than-honorable conditions (OTHC) discharge characterization. The commander could impose Article 15 punishment, and then follow it up immediately with administrative discharge proceedings (thereby discharging the person with no stripes on his/her shoulder and/or imposing a fine so they are discharged with little or no money in their pocket). Or, the commander could refer the case to trial by court-martial. If so, the commander could choose to convene a Summery Court (highly unlikely), a Special Court, or a General Court-Martial. If the commander chooses a Summery Court, the maximum punishment is limited to confinement for 30 days, forfeiture of two-thirds pay for one month, and reduction to the lowest pay grade. If the commander convenes a Special Court, the maximum possible punishment is confinement for 12 months, forfeiture of two-thirds pay for 12 months, reduction to the lowest pay grade, and a bad conduct discharge. If the commander convenes a General Court-Martial, the maximum punishment is what is shown earlier in this article for the offenses under the section "Maximum Possible Punishments."
(1) In the vast majority of cases, if a member has a clean record otherwise, and is absence for less than 30 days and voluntarily returns, they are allowed to remain in the military. Such usually receive Article 15 punishment.
(2) If a member is absent for more than 30 days, but less than 180 days, and returns to the military voluntarily, it could go either way. If there was a "reasonable" explanation for the absence (such as severe family, financial, or emotional problems), and the commander thinks the member has future potential, the commander could elect to allow the member to remain in the military. Otherwise, an administrative discharge is the most likely scenario (possibly combined with Article 15 punishment).
(3) If the member is absent for less than 180 days, and the AWOL/desertion status is ended by apprehension, the most likely result is an administrative discharge, under other-than-honorable conditions (OTHC), probably combined with Article 15 punishment. If the member went absent in order to avoid hazardous service (such as deployment to Iraq or Afghanistan), a court-martial is the most likely scenario.
(4) If the member is absent for more than 180 days, and voluntarily returns to military control, it could go either way. Depending on the circumstances surrounding the absence and the members prior conduct and performance, the commander may decide to impose administrative discharge (possibly combined with Article 15 punishment), or refer the case to trial by court-martial. If referred to trial, assuming there are no other serious charges, the commander would likely convene a Special Court, which would limit the maximum punishment.
(5) If a member is absent for more than 180 days, and the absence is terminated by apprehension, a court-martial is the most likely scenario.
I should mention here that, assuming there are no other serious charges, in the majority of cases where desertion/AWOL is referred to trial by court-martial, the member is allowed to request "discharge in lieu of court-martial," which means they agree to accept an other-than-honorable conditions (OTHC) administrative discharge, without fighting it (i.e., waiving their right to a board hearing), in exchange for not being tried by court-martial.
Keep in mind that the above are not hard-and-fast rules. They are simply my general observations over recent years. As I mentioned earlier, the individual who makes the ultimate decision as to how military offenses are processed is the commanding officer of the unit where the member is assigned after return to military control.
More About AWOL and Desertion