“And Mary Magdalene was there, and the other Mary…” The Bible tells us how the women knew about where Jesus was buried. It seems that they did not want to leave Jesus just hanging on the cross, so they stayed in the area. In any case, the women were still there when Joseph took Jesus down from the cross and carried his body away, and they followed Joseph, and sat down where they could see what he was doing (Luke 23:55). That is why Matthew 27:61 says they were “sitting opposite the tomb,” i.e., they were sitting in a way they could see the tomb. Nicodemus may have noticed them, or he may have been trying so hard to get finished burying Jesus before the darkness set in that he did not pay attention to them. After all, it was Passover, and Jerusalem was packed with people. The women noticed that Joseph did not properly prepare Jesus’ body for burial, but simply wrapped him in a cloth, closed the tomb, and left, which is why they went to prepare spices themselves. (see commentary on Matt. 27:60 and John 19:40).
[For more information on Mary Magdalene, see commentary on Luke 8:2.]