Observations have indicated that the prestellar core mass function (CMF) is similar to the stellar initial mass function (IMF), except for an offset towards larger masses. This has led to the idea that there is a one-to-one relation between cores and stars, such that the whole stellar mass reservoir is contained in a gravitationally-bound prestellar core, as postulated by the core-collapse model, and assumed in recent theoretical models of the stellar IMF. We test the validity of this assumption by comparing the final mass of stars with the mass of their progenitor cores in a high-resolution star-formation simulation that generates a realistic IMF under physical conditions characteristic of observed molecular clouds. Using a definition of bound cores similar to previous works we obtain a CMF that converges with increasing numerical resolution. We find that the CMF and the IMF are closely related in a statistical sense only; for any individual star there is only a weak correlation between the progenitor core mass and the final stellar mass. In particular, for high mass stars only a small fraction of the final stellar mass comes from the progenitor core, and even for low mass stars the fraction is highly variable, with a median fraction of only about 50%. We conclude that the core-collapse scenario and related models for the origin of the IMF are incomplete. We also show that competitive accretion is not a viable alternative.