Matchups denote the situations a unit performs best in.
A unit counters another unit if it easily wins against that unit. It hard counters a unit if it completely dominates that unit, with little threat to itself, even against massed numbers. It soft counters a unit if it usually wins in relatively even numbers (by cost), especially in a massed battle.
Likewise, a unit is countered by another unit if it easily loses to that unit. A unit is hard countered by if it stands no real chance against the target, even in large numbers. And it is soft countered by a target if it is unlikely to win in relatively equal numbers (by cost). A unit can also be countered by a special ability. In this case, a special ability hard counters a unit if it can destroy a unit. It soft counters a unit if it disables that unit or makes it substantially less effective without destroying it.
Some things are always considered counters and are assumed. Cloaked units always hard counter units without detection, for example. Likewise, stasis always soft counters a unit. Spellcasters with no attack like high templar, dark archons, defilers, queens, observers, medics and even arbiters and ghosts are easily hard countered by anything that can hit them, and so are omitted. Strategies for beating these spellcasters can be found on their unit pages. Infested terrans and nuclear missiles are also a special case - they are hard countered by anything they can't reach and instantly kill anything they can. Since they are very rare, they are omitted for clarity.
Air-to-ground units always counter ground units without a ground-to-air attack, but they are included for completion's sake.
Matchups can be dictated by a number of factors, including attack types, cost, speed or cooldown, armor, size.