It's very common in shows like Game of Thrones or Lord of the Rings to see lords and even commoners wear capes, but was it as common as pop culture makes it seem? Did capes serve any sort of purpose or were they more of a fashion statement?
I would split the answer to your question in two: those items were both for purpose and for fashion, but this duality changed over the course of the centuries.
As of the Late Antiquity we begin to see clothing already resembling capes and the like in several pieces of iconography like this one from a text of Vergil's Aeneid from 400 AD ca. Already a few centuries earlier (II-III ca.) we can see a sort of proper cloak as these gentlemen are showing in a reconstruction. This one was called a paenula and it resembles a poncho of some sort. Apart from these examples, Roman citiziens would always wear an additional piece of clothing over their simpler tunics, named toga (sometimes adding the adjective praetexta to specify the one worn by youths and magistrates, having a purple rim) as shown in this funerary casket found in an excavation in Egypt around 1899 and dating from roughly the II century. This too resembles a cape as we understand it although without a hood.
In the centuries of the Carolingians (VIII-X), clothing changed very little since the Late Antiquity in the West. The Stuttgart Psalter (820-830 ca.) shows that the design of the cloak and cape had become similar to models we can see in later illustrations: a square or semi-circle of cloth fastened at the shoulder with a brooch or clasp as seen here.
The Bayeux Tapestry (possibly 1070-1080) which recounts the Norman conquest of England, has several scenes where the design of cloaks and capes (seemingly interchangeable in this period) appears to bear little difference from those which can be associated with the earlier times. This scene with king Harold and a bishop shows it very well.
Additionally, the cloak of Roger II king of Sicily (1095-1154) is a rare case of fashion statement in a relatively simpler phase of the Middle Ages (nothing to compare to the Late Middle Ages wealth and fashion), as it was embroidered with a golden thread drawing two lions.
The Maciejowski Bible (or Morgan Bible) from the mid-XIII century shows a slight change in fashion, as cloaks and capes appear to have hoods integrated in them and also no longer being fastened on the shoulder but on the chest or around the shoulders (maybe only in a domestic context), like in these three examples.
It must be said that nobles and kings would have capes and cloaks of finer materials and quality, but nothing exaggerated as the Renaissance and Early Modern Age would bring.
Making a jump to late Middle Ages, capes and cloaks start to become more ubiquitous as they seem to acquire a much more important role in high society, possibly connected both to the generalized increase of wealth and prosperity and their function in maybe showing heraldry. The equestrian monument for the English mercenary captain John Hawkwood (1320-1394) placed in Padua in 1436 and made by Paolo Uccello, shows Hawkwood wearing a cape over his armour while marching, maybe to signal his presence during combat.
The Issogne Castle in the Aosta Valley has a wealth of frescos from this period (XV-XVI centuries) showing scenes of daily life. In these images we can see capes as frequent clothing.
Similarly, the paintings on the walls of the Schifanoia Palace (literally, "Boredom-avoiding") of Ferrara, built in 1385 by the Este lords of the city as a place of relaxation, show the clothing of the era.
To sum it up, capes and cloaks, I reckon, started to become widespread and important (for different reasons) at the end of the Medieval period, if we connect them with style and fashion rather than with function.