This is a question as broad as asking where do ideas come from? But to answer the question for at least one well known character, designed for the video game Donkey Kong and starring in many games since, the constraints imposed by technology of the time helped to design one of the most iconic characters in video games and popular culture.
That character is Mario the Italian plumber created by Shigeru Miyamoto and first appearing in the aforementioned Donkey Kong in 1981.
Back in the early eighties the resolution and file sizes that video games could use for characters was very minimal. Due to this the character that ended up becoming Mario needed to have some definition to his body and face to allow features and appendages not to blend into one another. To address this Miyamoto decided to put his character in dungarees so that the arms would become distinct from the body and therefore the character became, at first, a carpenter and latterly a plumber. To let the player know which way Mario was facing Miyamoto decided he needed a nose. This addition would make the face seem oddly shaped so the moustache was used separate the nose from the chin and to give more definition to the features.
Why an Italian plumber rather than, for example, a Japanese plumber? Well in the words of Miyamoto himself from 2010:
“As a kid, I was a big comic fan and I liked foreign comics as well. So I drew some characters that had more western type features with a little bigger noses and what not. Now with Mario, I think with Mario Bros. we had a setting of course that was underground, so I just decided Mario is a plumber. Let’s put him in New York and he can be Italian. There was really no other deep thought other than that.”
So, that is how you design an iconic, globally recognised character.