They neutral, they have outpost (castle), and they do form patrols.
If knight patrol meets pillager patrol they start to fight.
You can trade with knight like you do with villagers.
When you have good relations, knights can sell you knight spawn item.
If you activate this item (put in in your hand and press LMB) two knights will spawn near you, and start to attack your enemies.
It is, obviously, useful in some situations: when you fight many mobs, and you going to die soon, or during village raid.
If you activate knight spawn item in village, those knights will start to protect village like iron golem do (will be attached to the village).
You can have only one spawn item. You can not trade second one until you use first one.
If you attack knight, all other knights in the area become hostile (as pigmen)
If you kill banner carrier, you will get effect which will cause all knights you meet during next 5 game days (that's how it lasts)- attack you. Also, knights patrols will spawn 2 times often during this period (hunting for your head). As long as every patrol includes banner carrier, you will have this negative effect permanently if you engage fighting. So better strategy is to not mess with knights, or hide from them next 5 days if you kill banner carrier.
Also, you can meet knights sitting next to campfire at the night (this is coolest part!).
Imagine, you have no bed, you lost in the forest. You escaping from mobs, and you see glowing behind trees. It could be lava lake, but.. You approach, and you see campfire, and knights patrol seating around. Like in fairy tale!
If you enter the radius of such campfire - mobs will no longer attack you (they can not approach). Or they can, but knights will start to attack mobs within that radious.
Knights outpost and knights campfire is a good shelter.
I suggest Knights outpost to spawn in extreme hills biome, and knights campfire - in forest and dark forest.