it doesn't have a single logic to me either
check the bookcases near the shelf you put any book on and they would say stuff like war so place the book that best fits near it
Ami me falta un libro sabes dónde está?