Historically, ninjas (
shinobi-no-mono) were either loyal or paid servants of a lord or emperor, employed as bodyguards or for covert activities. If they were vassals of an allied ruler, they might receive no personal compensation whatsoever.
In fiction, they are paid in advance for services, or rewarded for their completion, or both.