If you ask me, Goblins and Orcs were created by magic, which mutated them. It apparently has different results on different races.
In the movie, that Gandalf's Guild Master said that Orcs were once Elves before the evil magic changed them. Maybe because the ones he had in his army were once Elves, they are big. If other Orcs were once Dwarves or Hobbits, they are smaller.
Also wasn't Gollum something else, like a Hobbit or Human, before the ring turned him into some sort of frog/lizard creature?