The recent detections of the ∼10 s long γ-ray bursts (GRBs) 211211A and 230307A followed by softer temporally extended emission (EE) and kilonovae point to a new GRB class. Using state-of-the-art first-principles simulations, we introduce a unifying theoretical framework that connects binary neutron star (BNS) and black hole–NS (BH–NS) merger populations with the fundamental physics governing compact binary GRBs (cbGRBs). For binaries with large total masses, M
tot ≳ 2.8 M
⊙, the compact remnant created by the merger promptly collapses into a BH surrounded by an accretion disk. The duration of the pre-magnetically arrested disk (MAD) phase sets the duration of the roughly constant power cbGRB and could be influenced by the disk mass, M
d
. We show that massive disks (M
d
≳ 0.1 M
⊙), which form for large binary mass ratios q ≳ 1.2 in BNS or q ≲ 3 in BH–NS mergers, inevitably produce 211211A-like long cbGRBs. Once the disk becomes MAD, the jet power drops with the mass accretion rate as
M
̇
∼
t
−
2
, establishing the EE decay. Two scenarios are plausible for short cbGRBs. They can be powered by BHs with less massive disks, which form for other q values. Alternatively, for binaries with M
tot ≲ 2.8 M
⊙, mergers should go through a hypermassive NS (HMNS) phase, as inferred for GW170817. Magnetized outflows from such HMNSs, which typically live for ≲1 s, offer an alternative progenitor for short cbGRBs. The first scenario is challenged by the bimodal GRB duration distribution and the fact that the Galactic BNS population peaks at sufficiently low masses that most mergers should go through an HMNS phase.