The only free and comprehensive online etymological dictionary of the Spanish language
caber (Verb) "to fit"

12th cent. From Latin capere "to take in," "to capture." From Proto-Italic *kap-i- 'id.' Of unknown origin.

Romance: Western Vulgar Latin: Asturian caber, Portuguese caber, Galician caber, Catalan cabre

Germanic: East Germanic *habēn-: Gothic haban "to have;" North Germanic *habēn-: Old Norse hafa 'id.;' West Germanic *habēn-: Old High German habēn 'id.,' Old Saxon hebbian, Old English habban (English to have)

Balto-Slavic: Baltic *kh2-en-p-e-: Latvian kàmpt "to obtain"

Albanian: kap "to seize" (kapa)