We study the distribution of cold dark matter (CDM) in cosmological simulations from the FIRE (Feedback In Realistic Environments) project, for $M_{ast}sim10^{4-11},M_{odot}$ galaxies in $M_{rm h}sim10^{9-12},M_{odot}$ halos. FIRE incorporates explicit stellar feedback in the multi-phase ISM, with energetics from stellar population models. We find that stellar feedback, without fine-tuned parameters, greatly alleviates small-scale problems in CDM. Feedback causes bursts of star formation and outflows, altering the DM distribution. As a result, the inner slope of the DM halo profile ($alpha$) shows a strong mass dependence: profiles are shallow at $M_{rm h}sim10^{10}-10^{11},M_{odot}$ and steepen at higher/lower masses. The resulting core sizes and slopes are consistent with observations. This is broadly consistent with previous work using simpler feedback schemes, but we find steeper mass dependence of $alpha$, and relatively late growth of cores. Because the star formation efficiency $M_{ast}/M_{rm h}$ is strongly halo mass dependent, a rapid change in $alpha$ occurs around $M_{rm h}sim 10^{10},M_{odot}$ ($M_{ast}sim10^{6}-10^{7},M_{odot}$), as sufficient feedback energy becomes available to perturb the DM. Large cores are not established during the period of rapid growth of halos because of ongoing DM mass accumulation. Instead, cores require several bursts of star formation after the rapid buildup has completed. Stellar feedback dramatically reduces circular velocities in the inner kpc of massive dwarfs; this could be sufficient to explain the Too Big To Fail problem without invoking non-standard DM. Finally, feedback and baryonic contraction in Milky Way-mass halos produce DM profiles slightly shallower than the Navarro-Frenk-White profile, consistent with the normalization of the observed Tully-Fisher relation.