Planets that orbiting other stars are really evaporated dear star, all the elements such as carbon, oxygen, calcium, magnesium, sodium, nickel, and iron are produced in the center of star by stellar nucleosynthesis process.
When a small star captured by a near by big star, the outer gaseous part of small star evaporated by the radiation of the big star. In the evaporation process the captured star loss most of it's mass and finally becomes a planet with few or huge gas atmospheres depending upon the distance from the big star.
For example if the distance is very close then an inner rocky planet will be formed otherwise a Jupiter like gas giant will be formed. For example earth sized diamond planets are closely orbiting a highly radiating pulsar star called as psr 1257+12.
similarly cometary planets are closely circling sun like star.these planet size comets are losing gas by evaporation due to the radiation of the stars which they orbit.and finaly star size planet also orbit a central star called as 15 sge gas giants which is 75 times the mass of Jupiter orbiting a star like a planet itself proved that planets are captured dead star.