The crook (Heqa-sceptre) is originally a long staff curved at one end, as used by herdsmen. It became a sign of kingship via the metaphor of the king as herdsman. The crook, and also the flagellum, are also divine attributes, mainly for Osiris, but also for moon gods (Khons) and even for Anubis and Harpocrates.
The king is depicted with a crook in his heb sed robes and in depictions of the king as Osiris. Even without the flagellum the crook is a symbol of power, and as such is also found held by high officials.