These questions are the basis of OpenAM and I recommend that you read some introduction materials about OpenAM. A good reference is the OpenAM book published by PacktPub : https://www.packtpub.com/openam/book.
OpenAM is embedding OpenDS as its configuration datastore, and can leverage OpenDS (or ForgeRock led OpenDJ, the continued open source LDAP directory project derived from OpenDS) as the user data store. In both cases, OpenAM interacts with OpenDS using LDAP, as OpenDS is an LDAP directory server.
OpenAM Installation guide describes installation of OpenAM with OpenDS/OpenDJ as the User datastore installed on a different machine: http://openam.forgerock.org/doc/install-guide/OpenAM-Install-Guide.html
Web agents and policy agents are software agents that are installed on Web applications to communicate with the OpenAM service and provide Authentication and Authorization.
Kind regards,
Ludovic.