What is the main purpose of a semicolon?

to separate two independent clauses that are closely related

to replace a comma between two independent clauses

to replace a colon between two independent clauses

to separate a subordinate clause from an independent clause