How the Matchmaker works
The Matchmaker (MM) puts together several ships that are in the battle queue to create a battle with no more than a 1 tier in ship difference.
The current MM model is +1/-1 which effectively means that you will encounter either ships 1 tier lower or 1 tier higher in a single battle, unless there are Divisions* present.
Therefore, should you choose a tier IV ship, you will meet either tier III and IV or tier IV and V ships.
The Matchmaker tries to mirror the classes and tiers as much as possible between the teams, but the requirements are progressively relaxed if the queues take longer than usual. However, the +1/-1 rule always stands true, except for tier I ships, that do not face higher-tiered opponents.
For Tiers VI and VII, the number of destroyers on each team will always* be mirrored, whereas, for other tiers, only battleships will have their number mirrored. Divisions* can cancel out that rule. Starting with the June 2020 Update, the destroyer mirroring rule will apply to battle Tiers IV and V as well.
*In rare cases when the queues take several minutes, this rule may be intentionally broken by the matchmaker.
The MM does not consider the player skill, current commander, the national affiliation of the ship or her loadout.
Exceptions
Divisions
Divisions are viewed by the matchmaker as the highest tier ship that's found within. E.g. if a division contains tier IV and tier V ships it will be matched as a tier V entity, making it possible to have both tier IV and tier VI ships in the same game. It is therefore advisable to use same tier ships in a division.
However, that's not an enforced rule.
You cannot go to battle in a Division if the tier difference between the ships therein is more than 1.
Tier I
By default, tier I ships are only matched against the same tier.
However, if tier I and II ships are in a single Division they can be put against other tiers III ships since the matchmaking entity of that division is tier II.