The difference between NIDS and HIDS and how do they help?

What is an Intrusion detection system? What are the different types of Intrusion detection systems available? How does each of these work to protect network security? What are the basic variants that are integral to both systems? Where in the network are anti threat devices employed in each of these systems?
