What Is a Comma Splice?
It's easy to see in that example why the error is called a comma splice because I’m using a comma to splice together two complete sentences when that isn't a comma’s job.
Commas aren't meant to join main clauses all by themselves; when you force them into that role, you make an error called a comma splice.
The good news is that it's easy to fix the problem. For example, because the two clauses are complete sentences by themselves, you can treat them that way and use a period where you had a comma.
Squiggly ran into the forest to hide. Aardvark realized he’d have to fight the peeves alone.
It is a period's job to separate complete sentences.
How to Use a Semicolon to Fix a Comma Splice
If the two sentences are closely related to each other, you can use a semicolon to fix a comma splice. For example, if we imagine that Squiggly and Aardvark were in the woods when their campsite was attacked by monsters called peeves and we’re describing our two characters’ reaction to the attack, you can use a semicolon to connect the two parts without a coordinating conjunction.
Squiggly ran into the forest to hide; Aardvark realized he’d have to fight the peeves alone.
The semicolon makes sense because the second clause is related to the first clause. Aardvark knows he has to fight the peeves alone because Squiggly has run off into the forest and is going to be useless. (Want more? See Episode 189, How to Use Semicolons.)
You can think of a semicolon as a “sentence splicer” because its job is to splice complete sentences together. It’s stronger than a comma.