The ability of carbon to form chains that are almost unlimited in length comes from the fact that a carbon atom can bond to other carbon atoms. Also, a carbon atom has 4 valence electrons which means one atom can bond to other four atoms. Hope this helps.