In exactly the same way anything else got its name or meaning. The language "evolved" just the same as any other language did. You may as well ask where the word "word" came from.
Obviously you're supposed to put contains when "something contains something else" such as "That jar contains food." then contain in a present tense sentence like "Can you contain your dog, please?"