Although the direct or indirect nature of the bandgap transition is an essential parameter of semiconductors for optoelectronic applications, the understanding why some of the conventional semiconductors have direct or indirect bandgaps remains ambiguous. In this Letter, we revealed that the existence of the occupied cation d bands is a prime element in determining the directness of the bandgap of semiconductors through the s-d and p-d couplings, which push the conduction band energy levels at the X- and L-valley up, but leaves the {Gamma}-valley conduction state unchanged. This unified theory unambiguously explains why Diamond, Si, Ge, and Al-containing group III-V semiconductors, which do not have active occupied d bands, have indirect bandgaps and remaining common semiconductors, except GaP, have direct bandgaps. Besides s-d and p-d couplings, bond length and electronegativity of anions are two remaining factors regulating the energy ordering of the {Gamma}-, X-, and L-valley of the conduction band, and are responsible for the anomalous bandgap behaviors in GaN, GaP, and GaAs that have direct, indirect, and direct bandgaps, respectively, despite the fact that N, P, and As are in ascending order of the atomic number. This understanding will shed light on the design of new direct bandgap light-emitting materials.