Secondary star formation within massive star clusters: origin of multiple stellar populations in globular clusters