复员 specifically means transitioning from military to civilian status. Compare with
退役 (tuìyì), which means to retire from military service (often for officers or after longer service).
复员 is used more for enlisted soldiers returning after their term of service or at the end of a conflict.