For example, Conrad of Montferrat was the cousin of the Holy Roman Emperor, King of France, and Duke of Austria. How did the rulers of this small region become related to the most powerful people in Europe?
Conrad, or Corrado del Monferrato was one of the largest landowners in Northern Italy; unlike Lombardy and the Venetia, the hummocky terrain of northwest Italy (where the Montferrat is located) did not favor the emergence of equally matched power-brokers, nor did it favor the growth of cities. Thus no rivals challenged the ruling House of the Aleramici, and the relatively deflated position of the Montferrat meant that when Otto of Saxony (the German Kaiser) usurped the crown of Italy from Berengar of Ivrea in 961, the Aleramo was largely ignored; it also helped that he seems to have sided with Otto once the going got tough for Berengar.
While the Ottonian Kaisers empowered the urban basilicas to rein in their Italian subjects, the less urbanized and in any case pro-imperial Montferrat received no such treatment.
Now; in the specific case of Conrad, he got lucky in that his father had landed a match with with Jutta of Barenberg. Leopold, the Magrave of Austria, just happened to have a spare daughter hanging around; he had already married off daughters to the Duke of Silesia and the King of Bohemia (securing his northern borders in the process) and was machinating his son Henry's usurpation of the Duchy of Bavaria. Another son was being funneled into the position of Archbishop of Salzburg. I suppose he could have shipped his daughter off to the east, but Hungary was in the throes of a succession crisis and Leopold wasn't about to commit resources and energy into propping up his son-in-law. So Italy it would be; however south of the Alps the ruling houses in the Veneto and Lombardy, the Sambonifacio and Obertenghi, had accepted enormous curbs on their power in favor of the cities (the Sambonifacio remained active and respected participants in local politics, but were challenged for their title by the Dukes of Styria, while the Obertenghi locked themselves in the castle of Este and were unheard from for the next two hundred years). So it would seem that Conrad was the best match.
So it was through his mother that Conrad was a cousin of the Holy Roman Emperor and a distant relative of the crown of France. It's unsurprising if you think about it: Conrad was one of the last great landholders in Italy, and one of the few whose line survived through the Ottonian, Salian, Hohenstaufen, and Communal eras. If the Magrave of Austria was looking for a match in Italy, few met their criteria like the Aleramici.