They were effectively power generators with legs and a very simple AI so they could understand rudimentary commands. They were commonly found on under-developed worlds that did not have an expansive power grid, or in mobile military operations.
There was alot of controversy back in the day that ole' George stole alot of his ideas from other movies. Well here is another example. It didn't get as much publicity because the gonk droid is a very minor character bur the similarities are pretty close. This is one of the droids from Silent Running an early 70's sci-fi movie.