c. 1300, "restrain (someone), control (oneself), behave (in a certain way)," from Old French contein-, tonic stem of contenir, from Latin continere (transitive) "to hold together, enclose," from assimilated form of com "with, together" (see con-) + tenere "to hold," from PIE root *ten- "to stretch."
From mid-14c. as "to have (something) as a constituent part;" from late 14c. as "have something inside, enclose." Related: Contained; containing; containable.