A few reasons:
a) in the past, royals and nobles only really got to meet other royalty and nobility socially
b) often marriages were made for political reasons to cement alliances
c) "people like us" are the people we feel happiest with and are most likely to marry (let's face it, we all mostly tend to marry people from a similar social background, don't we?) and the pool of people to achieve this is not very big, so marrying a foreign royal is an easier way to achieve it. Just look at the number of British and English monarchs who had foreign royal spouses... not least the current one!
So the family tree becomes one big tangled web. The most recent great exponent of this was Queen Victoria, whose nine children basically all married foreign royalty - not for reason b) as that had died a death with the rise of democracy and monarchs becoming less important, but more for reason a). The result is that just about every reigning European monarch is descended from her, and every reigning European monarch is in line to the British throne. The most distant is Queen Beatrix of the Netherlands, who is about 800-and-somethingth in line.
On reason b), I cannot help remembering an episode of "The Black Adder", a British sitcom set in around the 15th century. The fictional King Richard IV decides to make an alliance with Spain as it is the country most threatening to France, and to show his seriousness, arranges for his eldest son to marry the Infanta (princess) of Spain. He protests that he is already engaged to nine other foreign princesses and countesses so the King decides to marry off his second son, Edmund, Duke of Edinburgh, instead. This is torture for Edmund as she turns out to be fat and ugly - and can't speak English so her interpreter has to be around all the time, even when they are in bed. Then the political situation changes and the King calls off the wedding as it is now imperative that he forges an alliance with Hungary. A Hungarian princess happens to be a wedding guest and she is called forward. She is indeed pretty - and also aged about ten. The episode ends with the (happy?) couple in their bedroom, naturally in separate beds, and him reading her a bedtime story. The overall joke is that this WAS quite a common thing at that time.
Edit - "Lord Lucan" really should get out more. Incest is of course dangerous but the only European royal family for which this has ever been a real problem is the Spanish Habsburgs. From about 1550 onwards they only married within the family "to keep the royal blood pure", quite often uncles marrying nieces, and it killed them off. They ended up with a higher rate of miscarriages than the Spanish peasantry and their ultimate achievement, if you can call it that, was King Charles II of Spain, who had every disability and illness due to inbreeding known to man. How he survived to the age of 38 can only be explained as he was royal and had the best of medical care available. Crucially, he was infertile and couldn't produce a child even from being married twice and when he died in 1700 the result was the War of the Spanish Succession thanks to the delicate political situation in Europe at the time. The successor would have been a French duke and the idea of France and Spain uniting to become a superpower totally scared the rest of Europe.