As with glass panes and fences, iron bars can be used to create narrow slits when placed between a door and a solid block. Mobs can see through and attack through these gaps, and arrows may be shot through them. Also as with fences and glass panes, arrows cannot be shot through iron bars themselves. Iron bars are also used to speed up the curing process of zombie villagers.
A zombie villager kept in a cage made from iron bars (via screenshot)
ncG1vNJzZmivmaC2b7%2FPqKmtq5uasqWtjZympmednrumr9Gana1nmae8r3nBmqms