명이 is the word used to indicate that the number is a 'counter' for people. Just to let you know that the number isnt talking about the amount of books (in this case). That 'counter' changes when you are talking about animals (마리), age (살), machines/cars (대), or just a general counter (개).
Hope that helps!
One word is a classifier/counting word and the other is the word for person. In many Asian languages, when you are counting nouns there you have to use both a noun and a counting word/classifier. If you're talking about people in English, it's sort of like asking "how many people are there?" and replying with "3 persons of people." In English the word itself can often be used as the classifier and can be omitted, especially when you have whole amounts of something, so you would say 3 people and not 3 persons of people. If you're talking about cakes though, you can have 3 slices of cake, then slices is the classifier. You could also have 3 whole cakes, then you would drop the classifier and usually say you have 3 cakes.
Just like 개 is a general counter for objects, 명 is the counter for people. It is necessary in Korea to use the appropriate counter after the number when stating how many of something there are. 명 doesn't mean people on itself, you cant use it as a noun like 사람, but you must use it when counting people.