An intrusion detection system monitors network traffic and identifies patterns of suspicious activity. If it detects potential threats, it will assume the network is under attack and send out an alert.
Essentially, it inspects all inbound and outbound network activity and acts as a security check on all transactions that take place in and out of the system.
A firewall performs actions such as the blocking and filtering of traffic based on a set of pre-configured rules. So, while an IDS (Intrusion Detection System) can only report an intrusion, an IPS (Intrusion Prevention System) can block unauthorised access.