You have to beat one of the games, in order to get a password that links the games together. (This is either the Labrynna secret or the Holodrum secret, depending on the game you start with). This is called Main Linking, and allows you access to different content, along with "secrets" from characters, which are passwords you can take back to the original game you played.
According to the Zelda Wiki:
When you complete Oracle of Seasons or Oracle of Ages and enter the other game with a password link, you'll find that some characters have clues and five-character passwords that tie in to the first game you played. Go back to your saved file in that game and give the passwords to characters who ask you for "secrets". They will give you new items or item upgrades, often as the prize of a mini-game
at the end of a Linked Game, the Hero's Secret is received. Inputting the Hero's Secret at the start of a new game (the same one that was played with a Linked Game) allows Link to experience the game without the Linked Game's altered plot. Rings from the two previous play-throughs can also be transferred to the this game file. At the end of the "Hero's Game", the Holodrum Secret or Labrynna Secret (depending on the game) will be obtained, allowing Link to experience another Linked Game for whichever game left. Therefore, the Hero's Secret allows the player to experience both games with the original and altered storylines.