Did Ravana really have ten heads? Or is it a mythical concept?
If he really had ten heads, who gave him this and what is the story behind it?
Yes, Ravana literally had ten heads. This excerpt from the Uttara Kanda of the Ramayana describes Ravana's birth:
[T]he girl [Kaikeshi]... after a length of time brought forth a very terrible and hideous offspring having the form of a Rakshasa, — having ten necks, furnished with large teeth, and resembling a heap of collyrium, with coppery lips, twenty arms, huge faces, and flaming hair. On his having been born, jackals with flaming mouths and other ferocious beasts began to gyrate on the left. And that god showered down blood; and the clouds uttered forth harsh sounds. And the Sun was deprived of his splendour; and meteors began to dart to the earth. And the earth shook; and the wind swept away violently. And that lord of streams — the ocean, which was calm before, became agitated. And his sire resembling his grand-father named him, (saying), "As this one hath been born with ten necks, he shall be called Ten-necked."
Now as described in another excerpt from the Uttara Kanda, Ravana cut off nine of his heads in the course of his Tapasya (deep metitation), but then Brahma restored them:
And the Ten-necked one passed ten thousand years without fare. On a thousand years being complete, he offered his own head as a sacrifice to Fire. In this way he passed away nine thousand years ; and nine of his heads entered into Fire. And as in the tenth year he intended to strike off his tenth head, [Brahma] the Great-father presented himself at that place.... [Brahma said] "Hear! I having been gratified, will confer on thee a fresh boon. O Rakshasa, O sinless one, those heads of thine which have been offered as sacrifices and which have sunk into the fire, shall again be thine.
Ravana's heads also play a role in the final battle between Rama and Ravana, because as Rama kept cutting Ravana's heads off they kept magically regrowing, as described in the Yuddha Kanda of the Ramayana:
Thereupon, the great-armed Rama who augmented the fame of the kings born in Raghu dynasty, stretching with anger, the serpent-like arrow with his bow, chopped off the glorious head of Ravana, which was graced with blazing ear-rings. Then, all the three worlds saw that head, fallen on the ground. Another head, exactly similar to that head, cropped up on the shoulders of Ravana. That second head was again chopped off by Rama, possessing a swift hand and who was swift in his act. The second head of Ravana was cut off by arrows in that battle. Soon after that head was chopped off, it again rose into view. Rama chopped off that head too with his arrows looking like thunderbolts. In the same manner, a hundred of Ravana's heads of equal splendour were chopped off by Rama. Yet, no certainty about Ravana's death could be seen.
It was only when Rama hit Ravana's chest with a Brahmastra that Ravana finally died.
Rāvaṇa is depicted and described as having ten heads and two ears in total. His ten heads represents that his knowledge of the six shastras and the four Vedas. Lord Shiva also gave him the name "Dashaanan" (Dasa = ten, mukha/anan = face), after he offered his ten heads to Lord Shiva.
The ten heads also represented passion, pride, anger, greed, infatuation, lust, hatred, jealousy, selfishness and ego when he offered them to Lord Shiva.
Ravana is not having 10 heads in all. He is having so many bad qualities that makes 10 heads in all. His every head depicts bad quality i.e. lust,anger,envy,greed etc. So,according to me Ravana was a normal person at birth and with the passage of time and he got educated so much of all the bedas and scriptures that he have got bad qualities that he knows everything and that makes everyone believe that he was having 10 heads in all.