The term "4X" traces its origins to Alan Emrich who was reviewing Master of Orion for Computer Gaming World. In his review Emrich went on to describe strategy games that put a great emphasis on exploring territory, expanding borders, exploitating resources, and exterminating the competition instead of strategy games that emphasized strict management of units and buildings. The four attributes he describes in his review are eXplore, eXpand, eXploit, eXterminate - the terms from which the name "4X" originates. Oddly enough, Alan Emrich would go on to become the lead designer of Master of Orion 3, and in that game Emrich extolled how it was a 5X game by adding eXperience as a significant gameplay component.
While the four Xs of 4X are easy to describe the genre itself is more ambiguous. Many strategy games feature the 4Xs but are not necessarily considered 4X games. Beyond the 4Xs, games in the 4X genre are noted for their complexity, allowing players to manage their empire's government, economy, diplomacy, research and technology. Many games in the genre like the Civilization series have large and comprehensive research trees for players to utilize. Similarly most 4X games utilize multiple interface screens and stat sheets.
Because exterminating the competition is one of the main components to 4X games combat is usually a significant portion of 4X games. Combat in 4X games is usually interconnected with technology and research whereby having certain technologies allow for better and stronger military units. However many games in the genre, such as Galactic Civilizations, give very little control over the actual unit combat. While commonly associated with turned based combat many 4X games such as Sins of a Solar Empire and Sword of the Stars use real time combat.
Related to extermination and exploration is diplomacy and with almost all 4X games players will encounter other civilizations they are either working with or are competing against. While players can outright declare war on these factions they usually are allowed to open a peaceful dialogue first and may even commence trading with another empire. As a result many 4X games include victory conditions that are "peaceful" or at least do not require the extermination of every civilization or empire from the game map.