An ATS functions by following a set of algorithms that dictate when and how to trade. These algorithms can be based on various factors such as technical analysis, market conditions, or even social media trends. Once the criteria are met, the system automatically executes the trade without human intervention. This can include both buying and selling of stocks, bonds, or other financial instruments.