There is a lot of information about this everywhere, including MSDN. However, I am a visual person who understands diagrams more than pages of text. So I have created a simple diagram illustrating this :
The small white ovals represent the various agents :
SA — Snapshot Agent
LRA — Log Reader Agent
DA — Distribution Agent
MA — Merge Agent
QRA — Queue Reader Agent
In a typical case, all these Agents reside on the Distributor (the yellow cylinder), making this database rather crucial in your topology. In pull subscriptions, there is an exception : both the DA and MA reside at the Subscriber(s).
The arrows show the typical functions of each Agent. For example, the SA is used in all replication types to create snapshots in the snapshot folder and records this status on Distributor. The LRA brings transaction logs from Publisher to Distributor, and so on.
Feel free to reuse this diagram, and do let me know of any suggestions, errors, etc as always.