ἕκαστος (hekastos) means "each of many"; ἑκάτερος (hekateros) means "each of two."
These forms look (respectively) like the superlative and comparative degree of the same word *ἑκας. Does such a word exist? If so, what does it mean?
Beekes covers this:
ETYM The solution of Wackernagel KZ 29 (1888): 144ff. is probably correct (see also Schwyzer: 6304): viz., that the word is from *ἑκάς τις 'every one for himself (cf. εἴς τις 'unusquisque'). From *ἑκάς τεο > ἑκάστου, *ἑκάς τῳ > ἑκάστῳ, the other cases (like ἕκαστος, etc.) were formed, along with the superlative in -ιστος. When ἕκαστος was analyzed as ἕκα-στος, this led to the creation of ἑκάτερος (lA), ϝεκάτερος; (Gort., Delph.) 'each of both' (based on ἅτερος, πότερος, etc.).
Note that there is a ἑκάς in Greek, which means "far away," but Beekes seems to indicate that the words are unrelated, since he asterisks the former. But they might not be unrelated. For the latter, it's the reflexive ἑ + the distributive suffix -κας, which to my mind at least makes logical sense for "each, every." Perhaps Beekes meant that it's independently formed, or perhaps there is some other reason the two cannot be the same, but I'll let someone else answer to that.