Before Perseus was born, his grandfather, Acrisios imprisoned his only daughter in a dungeon so if she bore a child he wouldn't be able to kill him.
The daughter was too beautiful for Zues to resist so he used his powers to cause the birth of a child.
After the discovery, Acrisios couldn't hold his anger so he flung his daughter into the sea in a chest.
When the daugther was found by King Polydectes, soon after the child was born, Polydectes gave him challenging tasks to complete.
After completing the challenges, Perseus decided to visit his grandfather who fled as soon as he heard about the news in fear that his son would kill him as stated in a prophecy
To not waste time, Perseus attended a discus contest while waiting for his grandfather to arrive, which ended up being a disaster because during the contest Perseus lost control of the disk and killed his grandfather who was in the crowd of spectators.