Arguably one of the most useful units in the game, Engineers are recruited from the Engineer's Guild and will rebuild your Castle walls during times of Siege, assuming you have enough Stone available in your Stockpile. This is particularly useful for two reasons.
Firstly, it means you do not need to concentrate on rebuilding walls yourself and instead can focus on the battle, and secondly, if enemy units are very close to your walls you will be unable to rebuild them yourself manually anyway because they will be deemed too close. Engineers will rebuild them automatically for you regardless of the distance between your castle and enemy units.
As well as rebuilding your castle, Engineers man siege equipment and can make boiling oil through the Oil Smelter as well. You can recruit Engineers from the rank of Knight Bachelor, as this is when the Engineer's Guild becomes available. You will need 30 gold as well as 1 peasant from the campfire before you can recruit an Engineer.