I read in a book that Jesus and Mary were very close.
Yes, she was his mother.
How much closer can you get?
Also, consider how in Israel and Judah the mother of a king was the queen. If you read the book of kings they often mention the name of the king’s mother along with the name of the king. It might seem strange to us to mention the mother, but she was obviously an important enough person to mention her name in the Bible along side each king.
Now consider that Jesus is the prophesied Davidic King, son of David, whose throne would endure forever. What then does that make Mary as the mother of this King? The Queen of course.
"Say to the king and to the queen mother,… " (Jeremiah 13:18)
As to whether Mary fully comprehended the death of her son would depend on whether God wanted to reveal that to her. Jesus didn’t tell Mary everything. He didn’t tell her and Joseph he would be in the temple (his Father’s house) for instance when they thought they lost him as a boy. It was something they had to learn through experience. It could be the crucifixion was this type of event where she could not really comprehend it until she experienced it and the Resurrection.
Jesus told his diciples ahead of time that he would die but also be raised on the third day. I would think he did this to warn them what was going to happen but also so they would realize after the fact that Jesus reassured them these things would come to pass and that death could not hold him down because he was God’s Son.
Mary being closer to Jesus and herself being full of grace it would not surprise me if she has special knowledge about these events before hand. Nonetheless, it would still have been torture in any case for her to see her son crucified. Did God want to spare her from unnecessary worry about her son’s crucifixion beforehand? Nevertheless, imagine how she felt to see her son rise from the dead and overcoming death itself for all of us.