An intrusion detection service (IDS) monitors network traffic and identifies patterns of activity. If it detects something suspicious, it will assume the network is under attack and send out an alert. Essentially, it inspects all inbound and outbound network activity, against a list of preconfigured signatures, 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 incoming and outgoing traffic based on a set of pre-configured rules.