Looking up their definitions:
There seems to be no logic behind combining 客 and 气 to give 客气.
Question: How does 客 and 气 combine to give 客气?
"客气" can be traced back to a story in The Spring and Autumn period(I did search this term....what an awkward name). This term was to describe actions that not from the heart, just for being polite. Now it becomes a neutral term - "you're welcome".
'polite' comes from the Latin politus "refined, elegant, accomplished," literally "polished," past participle of polire (polish, not Polish), but that doesn't mean someone who is polite is shiny!
Maybe it originated from 'in the spirit or air of a guest', the assumption being, a guest is very well behaved. (Back then the Chinese never had English guests perhaps, or they might not have used this metaphor)
气: (19) 指精神状态,情绪 [morale;spirit] or
气： (25) 中医学术语。指脉气和营卫 [energy of life;vital energy]