The situation is that Hamlet knows he was summoned there by Claudius. Claudius, himself, tells us that he summoned Hamlet. Hamlet finds Ophelia there, and then she returns the gifts he gave her, so Hamlet thinks Ophelia is returning his gifts because Claudius told her to.