How to explain the existence of heavier elements in Population I stars and in Population II stars contain lighter one Recently I read Astrophysics Notes where I found a statement that   young stars are classified as Population I stars and relatively older one as  Population II stars. Population I stars contain heavier elements or "Metals" - that means elements other than helium and hydrogen. While Population II contain older stars and they contain Hydrogen and Helium - lighter elements more in abundance.
My doubt is that, stars begin their journey from Hydrogen in nebula. In course of time due to nuclear reactions more and more heavier nuclei are created,and hence Population I stars which should contain lighter elements in much abundance and the older Population II stars should contain heavier elements. Whether the explanation of the Notes is wrong? or any other plausible explanation? Please clarify. 
 A: You are neglecting two important facts. 
The first one is that stars, toward the end of their lives, return to the interstellar medium (ISM) a lot of their initial mass, but now enriched with heavy elements produced by nuclear reactions inside the stars themselves. 
In this way, younger stars which form from the ISM begin their life with a larger fraction of heavy elements than old stars, which formed earlier when the ISM was less enriched than it is today. 
Most stars return a lot of material to the ISM, with the only exception of very low mass stars. This occurs in different ways, depending on the star mass. 


*

*Stars heavier than $8 M_\odot$ (that's eight times the Sun) first lose mass through powerful winds (in the most extreme cases, the so-called Mira variables, a heavy star can throw away 90% of its mass), then with SN explosions. 

*Stars lighter than $8 M_\odot$ do not experience SN explosions, and undergo lower rates of mass loss, but they still lose much mass. 

*Stars roughly the mass of the Sun also lose mass, in much less powerful winds or in the so-called Planetary Nebula phase, on their way to becoming a small white dwarf. The PN ejections are rich in CNO, as shown by the fantastic colors of their surroundings. 

*Lastly, stars considerably lighter than the Sun shed little or no mass.
Keep in mind that all of these episodes of mass loss occur when the star is old, i.e. when most material has gone through one stage of nuclear burning (H-> He) or maybe even more (He-> C,N,O, CNO-> Fe,Mn,Mg,...), so that the material returned to the gaseous phase (the ISM) is much richer in heavy elements than that from which the star formed. 
There is a second fact to keep in mind. Since large stars burn nuclear fuel much faster than low-mass stars (there is an approximate law $L \propto M^4$ relating luminosity to star mass), large stars live very little, a few million years, while low-mass stars formed shortly after the big bang are still here. So, when you are talking about PopII stars, those are old: they formed a long time ago (from 12 to 7 billion years ago in our Galaxy); instead, PopI stars are either intermediate in age (like the Sun, 4.5 GYr old) to very young (even just 1 Million years ago!). 
What this means is that, with PopII stars you are seeing stars that burn nuclear fuel very slowly, and formed when the ISM had not yet been enriched by the recycling of stellar material. With PopI stars you see instead stars which both formed recently, from an enriched ISM, and which bring to the surface the products of their own nuclear burning. Both effects make PopI stars much richer in heavy elements than PopII stars.  
A: A brief overview of stellar evolution can be depicted in the following image:

(From here which says it is originally from an encyclopedia; click here for larger image).
The heavier stars (top track) have very short life times (a few million years) because they run through hydrogen, helium, carbon+oxygen, ..., iron fusion in the core. Once a particular amount iron is formed, the star explodes in a core-collapse (Type II) supernova and something like 90% of the star is kicked off in a massive explosion. This matter returns to the nebula in which it was formed with a higher metallicity (more heavier elements). Note that the remnant of the star is either a neutron star or a black hole.
The lighter stars (bottom track) have very long life times (a few billion years) because they do not have enough mass to form much of anything past helium burning. The end of this star's life is as a white dwarf, but before it gets there it enters the planetary nebula phase in which it kicks off around half its mass (depends on other conditions, but this is a "good enough" value), which stays in the region in which it was formed.
Clearly both stars return a part of their material back into the region in which they were formed. When they return material, the metallicity, $Z$, of the region increases. This increased metallicity changes the types of stars that are formed. Population I stars are stars that formed in metal-rich environments (metal-rich being defined as $Z\sim0.3$) while Population II stars formed in mostly metal-poor stars (with metal-poor defined as $Z\lesssim0.01$). Thus, Population II stars are necessarily older than Population I stars because the environment in which the stars form (the nebulae) have not yet had enough time to have more metals donated to the region.
Note also that there is a possible third population of stars called Population III stars. These are currently undetected, though the forthcoming James Webb Space Telescope should be able to detect their remnants. This population of stars has a metallicity that is almost zero, $Z< 10^{-5}$, as they were proposed to have formed in the early universe (so primarily hydrogen with a small amount of helium, lithium, and beryllium).
