Why call it "counter"?

What is the thinking behind the name "counter" in type anatomy?

I'm recently pondering over the translation of some typography glossary. We all use "counter" to describe the space enclosed or half enclosed in a letter, but how did this name come into being?

Simply, which meaning of the word "counter" did they employ to refer to that part of the letter? Some people just relate the image of a cashier counter to this meaning but I don't think it fits...

(Sorry if this is a stupid question, I'm not a native speaker of English language. If someone can even provide some historical reference it would be much appreciated.)