The above “quote” is commonly attributed to Mark Twain. However, nobody seems able to find the source of this alleged quote. As a result, the quote’s attribution and its words feel somewhat ironic in combination.
Perhaps the true author was winking at us through the misattribution. Or perhaps the true author felt like the message was important and that it needed the old wisdom authority associated with a name like Twain’s to carry it forward.
In any case, the statement itself does ring true – thus its wide use.