Here's why:
* Independent Clause: A complete sentence with a subject and a verb.
* Conjunction: A word that connects words, phrases, or clauses.
Example:
* I went to the store, but they were out of milk.
Here, "I went to the store" and "they were out of milk" are both independent clauses. The comma separates the two, and "but" acts as a conjunction to connect them.
However, if "but" is connecting a dependent clause to an independent clause, there is no comma needed.
Example:
* I went to the store because I needed milk, but they were out of it.
Here, "because I needed milk" is a dependent clause that cannot stand alone as a sentence.
Remember: The comma before "but" helps to clarify the sentence's structure and flow, preventing confusion.