I think there is a rule that if the adjective is the composite of two words (i.e. δήμο + φιλής = δημοφιλής) then the masculine and feminine have the same ending ής and the neutral ές; see also: (ευ + τυχής = ευτυχής/ευτυχές)
Sadly it is not as simple as that, since there are composite adjectives with other endings than -ης -ης -ες, such as ο πολύτιμος, η πολύτιμη, το πολύτιμο (=precious, from πολύ = much + τιμή = value). There are also simple (i.e. not composite) adjectives with the endings -ης -ης -ες, such as ο/η ακριβής, το ακριβές (=exact).
You are right! Then, is there a (complex) rule that determines when the masculine and feminine adjectives share the same ending? or is it all based on memorization? ... I already feel sorry for those who try to learn Greek
As far as I know, there is no such rule... However, I think, when they do share, it is always -ης and the neuter is -ες.
I also felt sorry for myself and all other people around the world who learn English, for having to learn all these phrasal verbs, based on -right, memorization... I still remember only few of them... Each language has its hard parts, it seems.