If you want to get to the bottom of it then you must pay attention to the **individual meanings of characters** and **the story of their union**.

客氣(客气) is made of **客** (**guest** + untranslatable part of the meaning) and **氣** (**spirits** + untranslatable part of the meaning). In pretty much all eastern cultures a guest is usually a stranger with whom you haven't developed a close relationship yet therefore a guest is someone you know but still not necessarily accept as your friend. The reason why this situation is associated with politeness is because being able to make progress from **guest status** to **friend status** has been way more crucial for survival and one's well-being in "*The East*" than it is in "*The West*" therefore people would be willing to force themselves to temporarily alter their behavior and serve some extra kindness and niceness in order to remove the social distance and get accepted as soon as possible as their personal welfare would be constantly at stake otherwise.

礼貌 is made of 礼 (sincere respect offered by a candid person) and 貌 (appearance / form / stature / pose / how something looks / shape). Therefore the kindness and niceness observed in the behavior of such a person could possibly be more like a natural thing that happens due to the *personality-by-birth* rather than something produced and served like an actor's acting.

Note that in today's world, many native speakers never mind or even never realize these details and use both of them interchangeably.  
Also note that in its original meaning 客氣 doesn't imply any criticism as it does not put any emphasis on how fake or real the given person's ways are. 客氣 is more like the name of the speaker's mood. It's how one feels as a reaction to being offered some extra kindness and niceness, regardless of what the intention was.