Looking up their definitions:
客气 (kè qi) = polite
客 (kè) = customer; visitor; guest
气 (qì) = gas; air; smell; weather; vital breath; to anger; to get angry; to be enraged
There seems to be no logic behind combining 客 and 气 to give 客气.
Question: How does 客 and 气 combine to give 客气?