The algorithms perform trades based on some technique or strategy that is usually followed in the stock market.
The most common trading strategies can broadly be divided into trend-based and arbitrage.
These traditional signals like the moving average or arbitrage can also be combined in these algorithms and back-tested for maximum optimization and benefit.
An Example - AlgoTrader is an algorithm that uses a combination of signals from the market and news to place trades.