Generally speaking, ninjas, or ninjutsu practitioners, were impoverished samurai. They had nothing but the ability to kill and fight. However, they were usually used as scouts due to their ability to observe silently. Later on, people began buying children from peasant families and training them in this craft.
And a shinobi is a person engaged in espionage, but is not a ninja himself.
Auto-translated