Agency trading is largely concerned with minimizing implementation shortfall and finding liquidity.
If we split the decision to buy a stock from the actual trading of the stock, as is often the case with fund managers (decision makers) and brokers (trade executors), you can see why both are used.
From the fund manager's point of view, his decision to trade is often based on the closing price of the day's trading (along with the entire history of the stock and other signals/indicators).
Brokerage firms specialize in developing algorithmic strategies, and providing them to the institutional investment community, that aid in the quest to minimise slippage from benchmarks such as implementation shortfall, volume-weighted average price or time-weighted average price.
Alpha Profiling is an example of an algorithmic method of minimising implementation shortfall.