In Edward's reign the sheriff was the King's representative, the sheriff collected the revenue owed to the king from the shires and towns, including the geld tax.
He was the earl's representative, administering justice and ensuring the shire met its military's obligations.
After the conquest the roles stayed much the same, he just replaced the Anglo-Saxons with Normans.
The roles were:
To uphold the hierarchy and they had less power than the king, the Norman sheriffs had more power.
To uphold law and order, the Normans kept the same legal system, but added new laws.
Defense:
Sheriffs kept the role of organising the defense of the shire and gathering together tax.
Sheriffs were entitled to a share of the King's revenue. They also paid money to the king.