Could someone help me understand what Jane Austen meant when she said :

“There is so much of gratitude or vanity in almost every attachment, that it is not safe to leave any to itself.” - Pride & Prejudice, Volume 1, Chapter 6.

The speaker is Charlotte Lucas and she is conversing with Jane Bennet.