Ophelia gives her father, Polonius, the love letters Hamlet wrote to her, and in act 2, scene 2, of Shakespeare's play, Polonius reads these letters aloud to King Claudius and Queen Gertrude as a part of his presentation to the royal couple regarding his assessment of their son. He presents the letters as proof of Hamlet's infatuation with his daughter.
Polonius tells Claudius and Gertrude that, upon learning of the letters, he advised his daughter to rebuff Hamlet's advances due to their difference in station, saying "Lord Hamlet is a prince, out of thy star; this must not be." Essentially, he instructed Ophelia to ice out the prince. Ophelia followed this advice, and Polonius believes her rejection led the prince to fall into madness. He proposes his plan of spying on Prince Hamlet to determine if his theory is true, assess Hamlet's mental state, and observe the strength of Hamlet's love for Ophelia.