There are three senses of gist in the Oxford English Dictionary. We’re not concerned with its obsolete sense of a right of pasture for cattle (from Anglo-Norman agister, to pasture animals) nor its equally obsolete one of a stopping place or lodging (from old French giste, in modern French the more familiar gîte for a furnished holiday home). This one is the essence or substance of a speech or text.
It evolved out of the legal language in medieval England after the Norman Conquest at a time when court cases were recorded in French. There was a fixed phrase, cest action gist, in which gist is from Latin jacēre, to lie, be situated or figuratively to be placed in a particular state or condition, via Old French gesir, to lie. Its literal translation was this action lies. It meant that sufficient grounds existed for continuing with the action, a sense of lie which is still known in legal English.
Early in the eighteenth century gist shifted from meaning that an action was admissible or sustainable to referring to what the action was actually about. The phrases “the gist of the action” or “the gist of the indictment” were common:
Mr Sturgeon, the surgeon, depos’d, That being sent for, he came to Mr. Crispe at Coke’s about Eleven, found him wretchedly cut in seven places ... It will be too tedious to describe the other Wounds, only that on the Nose, because it was the Gist of the Indictment.
The Historical Register, 1722.
It took another century for this usage to extend beyond the legal world to mean in everyday language the essence of some speech or text.