1590s, "firmness of matter," from Medieval Latin consistentia literally "a standing together," or directly from Latin consistentem (nominative consistens), present participle of consistere "to stand firm, take a standing position, stop, halt," from assimilated form of com "with, together" (see con-) + sistere "to place," causative of stare "to stand, be standing," from PIE root *sta- "to stand, make or be firm."
Meaning "state of being in agreement or harmony" (with something) is from 1650s; meaning "steady adherence to principles, patterns of action, etc." is from 1716. Meaning "harmonious connection, as of the parts of a system" is from 1787.