One of the key mysteries of star formation is the origin of the stellar initial mass function (IMF). The IMF is observed to be nearly universal in the Milky Way and its satellites, and significant variations are only inferred in extreme environments, such as the cores of massive elliptical galaxies and the Central Molecular Zone. In this work we present simulations from the STARFORGE project that are the first cloud-scale radiation-magnetohydrodynamic simulations that follow individual stars and include all relevant physical processes. The simulations include detailed gas thermodynamics, as well as stellar feedback in the form of protostellar jets, stellar radiation, winds and supernovae. In this work we focus on how stellar radiation, winds and supernovae impact star-forming clouds. Radiative feedback plays a major role in quenching star formation and disrupting the cloud, however the IMF peak is predominantly set by protostellar jet physics. We find the effect of stellar winds is minor, and supernovae ‘occur too late’ to affect the IMF or quench star formation. We also investigate the effects of initial conditions on the IMF. We find the IMF is insensitive to the initial turbulence, cloud mass and cloud surface density, even though these parameters significantly shape the star formation history of the cloud, including the final star formation efficiency. Meanwhile, the characteristic stellar mass depends weakly on metallicity and the interstellar radiation field, which essentially set the average gas temperature. Finally, while turbulent driving and the level of magnetization strongly influences the star formation history, they only influence the high-mass slope of the IMF.