The Chicago Manual of Style says:
In regular prose, a semicolon is most commonly used between two
independent clauses not joined by a conjunction to signal a closer
connection between them than a period would.
The key word is independent; neither clause has any syntactic influence on the other. (The definition of an independent clause is one that can stand on its own as a sentence.) The close connection between the two clauses simply has to be clear somehow.
This article bemoans the much diminished use of the semicolon, and lists these rules for its use:
Rule #1: Use a semicolon to replace a period.
Rule #2: Use a semicolon as a super-comma.
Rule #3: Use a semicolon before a conjunctive adverb.
The article concludes:
To recap, a semicolon is used in place of a period when two clauses
are closely related; to separate a very complicated or long list; and
with a conjunctive adverb.