Investigation of the stability and electronic properties of a series of MC compounds and classic MAX phases, Mn+1ACn (M=Sc, Ti, V, Cr, and Mn; A=Al, Si, P, and S; n=1, 2, and 3), contributes to finding the intrinsic mechanism of the stability of Mn+1ACn and to the design of new Mn+1ACn phases. First-principles calculations show that the formation enthalpy of both MC and Mn+1ACn is directly correlated with the charge transfer from M-3d to C-2s and 2p orbitals. Correspondingly, the early transition metals with high electron donation ability are able to form stable MC phases. Among the various MC phases, MC is found to be electron-deficient, which is thus favorable to react with electron-abundant MA to form Mn+1ACn. Therefore, M2AlC and M2SiC can be more readily separated into two-dimensional M2C structures, compared to M2PC and M2SC.