A Campaign is a connected narrative of events.
In role-playing games, a campaign will often follow the adventures of a party over the course of several sessions (years' worth, in some cases) as they set goals, complete quests, and grow more powerful. Some end with the failure or deaths of the characters, some end with the characters retiring and "riding into the sunset" (and possibly sowing the seeds for a new generation of adventurers), while all too many, unfortunately, end because the players stop gaming together.
Wargames can also include campaigns, though their events tend to be exclusively battles. Some campaign systems, particularly those of skirmish-level wargames like Mordheim and Necromunda, focus on armies as a collection of individuals who gain experience, purchase and use equipment, and occasionally die in action. Army rosters often have spaces for names, significant events, and other personal details that may not matter on the tabletop but help to add depth to the characters.
Campaigns in tactical and strategic wargames can focus on armies as they change over time, but the scale of their games makes it difficult to track individual soldiers, so they tend to abstract the soldiers into squads that change as a unit, with a possible exception for special characters like leaders. A unit may "level up" if it survives a battle, improving a characteristic or gaining a special ability -- which it can then lose if it experiences casualties in a later battle.
Wargame campaigns tend to progress as a series of linked battles. The simplest campaign is probably the "tree" campaign, where the next battle is chosen based on who won the previous battle, until the campaign reaches an end node. For example, a campaign may begin with one player as "defender" and the other as "attacker," fighting a battle at a vital defense line. If the attacker is repelled, the next battle may be the defender's counter-attack as the attackers are hunted down; if the defender wins again, the campaign is declared a decisive victory for the defender, as the attackers were completely routed, while if the attacker wins, the defenders only win a minor campaign victory -- the defenses held, but the aggressors are far from finished. On the other hand, if the defenses fell in the first battle, the second battle might be the the defenders' desperate struggle in the city they were tasked with protecting. If the attacker wins again, total victory is theirs, because the defenses fell and the city was thoroughly sacked, whereas the defenders can blunt the outcome into a minor victory for the attackers by winning the second battle -- the city is damaged and the defenses are broken, but the attackers were made to pay dearly in the process.
Larger campaigns can have battles with effects on the entire remainder of a campaign. For example, in a campaign for control of a planet, the attacker may be able to obtain bonuses to future reserve rolls by destroying or capturing orbital defenses. A map may be used to define what objectives are under whose control, and when they can be attacked, and even who wins overall.
Massive campaigns can be fought involving many players and armies by awarding points to each faction depending on who fights and defeats whom. Such campaigns can also feature special battles for turning points, with bonuses going to whichever faction or factions win them; this works best if the campaign's "canon" outcome is already known, because then the turning points are already known. Forge World's Imperial Armour volumes contain campaigns like this, with the largest-scale probably being their Badab War two-volume set -- not only was the conflict itself largest in scale, as it took place over an entire sector, but the campaign system explicitly includes Battlefleet Gothic games as well as ground battles (though their new Horus Heresy line could potentially reach galactic size).