Noble Titles and Ranks

What is a count? or a duke? or a baron?

I know these are royal terms but how are they royal and how do you become them? What is their duty in the court? What's the difference between them? What are they?

   Can you become a Noble person? Yes, you can!!!
 These are not "royal " terms, there are titles of "nobility" that arose in Europe during the transition period between the end of the Western Roman Empire (476) to the rise of the "new" European monarchies (c.1000.) Through this period, Europe was flooded again and again with various migrating or plundering people. The Huns (c. 400,) The German tribes (450-500,) the Muslim invasion (711 - 732,) The Viking raids and conquests ( 793 - 1000,) and the Magyar raids (899 - 950.) The attempts of distant authorities, like the pope in Rome or the emperor in Constantinople, to "delegate" power, and the attempts of local leaders to fill a power "gap" led to the assumption and creation of "new" titles of authority and power.

The title Duke, for instance, comes from the Latin term dux or leader/commander. The historical figure of King Arthur may been an early example of the change of the title dux or duke from military commander to territorial lord. " Indeed, he (Arthur) is called dux bellorum in the Historia Brittonum, which suggests a memory of late Roman military titles, and may indicate some sort of unified command arranged between several petty kingdoms." Sheppard Frere in "Britannia"
The title count came from an administrative office of the early Frankish kings (Merovingian and Carolingian rulers of France,) The title outlasted the Frankish empire (Charlemagne) and the inheritors of the office became the "counts" of the middle ages. (The title of count merged with the Anglo-Saxon conception of Earl in England.)
In the "new" Europe of constant warfare, freedom was defined by the ability to fight, baron. later the lowest title of nobility, derives from the old Frankish word "baro" which means freeman or man. Like these other titles of nobility as Europe settled into monarchies (in England after1066,) baron changed from a title of a free warrior to a title of the tenants-in-chief (land owners) who held their lands directly from the king. Gradually, a distinction between the greater and lesser nobles emerged, so that a hierarchy of titles arose, first in France and Germany in the years 900-1000 and later in England. So that by the Beginning of the "high" middle ages ( c.1000) the ranks of nobility were established as mentioned by the answerer above. here is a site that explains the derivation of all the various titles:
Hope this helps. ;-)
  King, Duke, Marquess, Earl/Count, Viscount, Baron, Baronet, Knight/Sir, Squire.

All this titles did not exist at one point.