Grammar question. "which"

The first sentence is correct.

“Which” is a relative pronoun, and so it must refer to a noun.

Correct: I saw many lichens, which are a kind of fungus.

“Which” refers to the noun “lichens”.

In the second sentence, “which” is used to refer to a clause (“Women live longer and have fewer illnesses than men”) This is a common misuse of “which”.