Polydectes fell in love with Danae, and so wanted to get Perseus, her son, out of the picture. He thereby hatched a plot to send him on a suicide mission. Perseus had been raised by Polydectes' brother, Dictys, after Danae's father, King Acrisius of Argos had disowned her.
Polydectes placed some strong hints that he would love to have the head of Medusa, one of the Gorgons whose faces turn people to stone. He then announced that he would woo Hippodamia and so needed others to provide him with horses (a different myth). Shamed at having nothing to give, Perseus left to get him Medusa's head. To Polydectes' surprise, Perseus succeeded.
When Persues returned, he found that his mother was hiding from Polydectes, who was threatening her. Perseus killed him and made Dictys king.