The agent initially does not have any private keys. Keys are added using ssh-add. When executed without arguments, ssh-add adds the %HOME%/.ssh/identity file. If the identity has a passphrase, ssh-add asks for the passphrase. It then sends the identity to the agent. Several identities can be stored in the agent; the agent can automatically use any of these identities. Ssh-add -l displays the identities currently held by the agent.
The idea is that the agent is run in the user's local PC or laptop. Authentication data need not be stored on any other machine, and authentication passphrases never go over the network. However, the connection to the agent is forwarded over ssh remote logins, and the user can thus use the privileges given by the identities anywhere in the network in a secure way.
A connection to the agent is inherited by child programs. Under OS/2, ssh-agent creates an an open file descriptor which is inherited by all child processes. An environment variable (SSH_AUTHENTICATION_FD) defined by ssh-agent contains the number of this descriptor. This restricts access to the authentication agent to only those programs that are siblings of the agent, and it is fairly difficult to get unauthorized access to the agent.
The agent exits automatically when the command given on the command line terminates.