Is a mining program necessary for mining, or can bitcoind mine by itself? I'm having a hard time understanding the relationship between daemons (such as bitcoind or litecoind) and mining.  Some things I read make it seem that you need a separate mining app and some things seem to suggest that the daemon itself does mining.  Which is it?  I'm thinking maybe the daemon can do mining but it needs to be enabled and if you don't enable it you can use a separate app instead?  I'm confused.
The daemon can do mining using the -gen command line option, but it's CPU mining and is impractical nowadays.

Using a separate mining app is practical. That separate mining app connects to a running bitcoind via its JSON-RPC API in order to facilitate getwork or getblocktemplate requests necessary for hashing.

The JSON-RPC API is configured in bitcoin.conf or at the command line using these arguments:

-rpcuser=&lt;user&gt;        Username for JSON-RPC connections
-rpcpassword=&lt;pw&gt;      Password for JSON-RPC connections
-rpcport=&lt;port&gt;        Listen for JSON-RPC connections on &lt;port&gt; (default: 8332 or testnet: 18332)
-rpcallowip=&lt;ip&gt;       Allow JSON-RPC connections from specified IP address