This page of our guide to Minecraft has descriptions of the NPCs appearing in the game.
The Villagers are a bit different than the rest of the mobs. They populate only the randomly spawned villages. They are completely neutral, if attacked they escape and hide in their houses, where they also spend the night. They can be turned into Zombie Villagers after being attacked by Zombie. There are also children in the villages, which you can interact and barter with. They can also be turned into 'baby zombies", of weak attack and defense factors, but high speed and invulnerability to sunlight.
Their main function is to provide you with the opportunity to barter, where each Villager as a different barter offer.
They are friendly to their creator. They move around chaotically and leave a trail of snow behind. They are exceptionally weak and they attack by throwing snowballs at the enemy. They are exceptionally suicidal in their nature because, apart from the Endermen and Blazes no mobs take damage from snowballs and the Snow Golems are used to attacking anyone within the range of 10 bricks. In the warm biomes, Snow Golems melt. They can also melt if exposed to rain or lava. after they die, they drop 15 snowballs.
Iron Golems can be, by default, found in big villages, where they spawn sporadically and protect villagers. They are tough and have a strong attack, which additionally throws the opponent far away. Their health bar does not regenerate, but they can be healed with a thrown potion of healing. They are resistant to damage from falling and to drowning. Still, they have this annoying custom of exploring the world if they currently are not in a village. You can make one follow your character and protect you, using the lead.