I mean, it seems to me that the Smurfs must draw o. Legends of pixies and little folk and the like, but does it? Or did Hanna-Barbers just take the idea of little people and make everything else up?
After the Nazis occupied France in May 1940, they wanted to keep the film industry going there with the German-controlled Continental Films, founded only six months after the occupation. The managing director, Alfred Greven, was appointed by his personal friend Goebbels.
At this time, the young Belgian Pierre Culliford, aka "Peyo", was working as a projectionist in Brussels; while he had a love for Robin Hood and fantasy movies, he had to show mostly propaganda films.
It was in this environment we got Les visiteurs du soir, a 1942 film by Marcel Carné, set in 1485, about two envoys sent to the mortal world to cause mischief and recruit for the Devil. The envoys (semi-accidentally) start doing some good works, and the Devil needs to visit in person to fix things. While the production design was heavily influenced by Les très riches heures du Duc de Berry, a rather famous manuscript from the 1400s, the story itself was steeped deeply in fantasy, and Peyo watched it repeatedly. (As critics have later pointed out, the movie also could be viewed as a thinly veiled allegory for the Nazis invading France; while the director insisted it was not intended as such, the important thing is that the film managed to escape the censors.)
When the occupation of both France and Belgium ended, Peyo went from projecting to a short stint at a company called Companie Belge d'Actualités, owned by a journalist (Nagant) who originally aspired to make newsreels. Because of the occupation they had switched to animation instead. Peyo saw the designs for a film called Le Cadeau à la fée (The gift of the fairy) which included elves wearing flowers (this will be important for the story later).
Peyo went on to work in newspaper comics, before eventually landing a job at the magazine Spirou. This is where he made the fantasy comic "Johan et Pirlouit", keeping in mind his previous inspiration by cinema. It centers around Johan, a servant to a King in a castle, and Peewit, a dwarf hired as a court jester.
For The Smurfs ("Les Schtroumpfs") they were introduced during a Johan et Pirlouit comic entitled La Flûte à Six Trous about a flute that causes people to dance uncontrollably. The flute is stolen and Johan and Peewit end up seeking the creators of the flute.
Now, the origin of the Smurfs was due to Peyo needing a creator for the flute, perhaps a witch or sorcerer? Keeping in mind the film he saw at the CBA, he settled on "little creatures" that live at night but we rarely see, aka elves or leprechauns. The blue came from his wife (Janine "Nine" Culliford), who was his colorist. They were constantly hiding in leaves so couldn't be green, red was too visible, and yellow and brown ... they were trying to avoid the Smurfs looking like unfortunate stereotypes. Hence, by process of elimination: blue.
As far as the name goes, according to Peyo himself, it came from a slip of the tongue while eating at vacation. He asked for salt ("le sel")
Passe-moi le sel!
but accidentally asked for "le schtroumpf" instead
Passe-moi le schtroumpf!
(When later translated to Dutch this became "Smurf", which was re-used in English and elsewhere.)
While Peyo originally thought it was a "momentary craze for secondary characters", Les Schtroumpfs were quite popular and merited re-appearances and their own spin-off, followed by a series of TV shorts in the 1960s later assembled into a film (Les Aventures des Schtroumpfs). You mentioned Hanna-Barbara -- they came in fairly late, as the entrepreneur Stuart R. Ross spotted Les Schtroumpfs in 1976 when traveling in Belgium and secured the rights, leading to the launch on American TV in 1981. Peyo (and the former editor-in-chief of Spirou, Yvan Delporte) were involved with overseeing the scripts. (Johan and Peewit do still show up, but now as side characters.)
Contrary to the small, often evil characters in popular legends, such as gnomes and trolls, I wanted mine to be reassuring and kind. The Smurfs aren't really heroes. They form a community in which it is nice to live. Each one works for his pleasure. They practice the principles of equality, liberty, and fraternity.
...
You can watch a trailer for Les visiteurs du soir here.
Centre Wallonie-Bruxelles Paris. (2018). Expo Peyo.
Rose, C. (28 August 2018). Behind the Blue: The Story of Peyo. The Comics Journal.
I also referred to the Peyo entry of the excellent Lambiek Comiclopedia.
It's in French and I unfortunately don't own a copy, but there is a full biography of Peyo:
Dayez, H. (2018). Peyo l'enchanteur. Belgium: Niffle.