'Contain' is Latin for 'hold together' — the root 'tenere' spawned detain, maintain, retain, sustain.
To hold or include within itself; to have as contents; to keep within limits, to restrain or control.
From Old French 'contenir' from Latin 'continere' meaning 'to hold together, to enclose, to keep in,' composed of 'con-' (together, with) and 'tenere' (to hold). The Latin 'tenere' descends from PIE *ten- (to stretch, to hold). The sense development ran from 'hold together' to 'hold within' to 'have as contents
The word 'continent' comes from the same Latin 'continere' (to hold together) as 'contain.' A continent is literally 'continuous land' — land held together in one mass. And the adjective 'continent' (meaning self-restrained) also derives from the same verb: a continent person is one who '