Complex sentence: Removing one's hat is also a form of greeting: the origin of this is that knights were expected to remove their helmets when meeting their king; not to do so would be a sign of mistrust and hostility.
Split into simpler sentences: Removing one's hat is also a form of greeting. The origin of this is that knights were expected to remove their helmets when meeting their king; not to do so would be a sign of mistrust and hostility.