Here is a real life example from Gary Chan sharing the way he started running Algorithmic Pair Trading strategies. Its a pretty old video taken from NYC Algorithmic Trading Meetup. It is a must watch if you are algo trading enthusiast and willing to start your game.
Today, pairs trading is often conducted using algorithmic trading strategies(Rule based) on an Execution Management System. These strategies are typically built around mathematical models that define the spread based on historical data mining and analysis. The algorithm monitors for deviations in price, automatically buying and selling to capitalize on market inefficiencies. The advantage in terms of reaction time allows traders to take advantage of tighter spreads.