4X is a term used for video and board games alike. 4X games have a player controlling a race, civilization, empire, etc. and over the course of the game, will partake in the four actions that give the genre its title: Explore, Expand, Exploit, and Exterminate. I don’t know why they’re called 4X and not 4E but whatever.
Exploration involves interacting with a map with specific units. The map may be hidden or unveiled but the areas of the map that are being explored are important for the objectives of the game.
Expansion has players moving onto those areas on the map. The acquisition of these areas typically grant the player(s) something that is worthwhile towards the end game.
Exploitation involves the areas that players have expanded to. Typically resources or a secondary ability are tied to these areas which make them important for players to gain control of them.
Extermination is the act of war in the game, where you can force your opponent to lose their units. This could mean that the player is eliminated from the game completely but it is not a requirement.
Prominent examples of 4X games are Twilight Imperium, Dominant Species and Seafall. Space themes are abundant in the 4X world as it’s an incredibly easy theme to port to the nature of the 4X genre.
As noted by the examples above, most 4X games tend to be heavier affairs. There are exceptions to the rules, such as Tiny Epic Kingdoms, but those are more outliers than anything.