Yes, Prince William and Kate Middleton are distant cousins through their shared ancestry. The two are related through a mutual great-great-great-great-great-grandparent, Sir Thomas Leighton, who was born in 1535.

Sir Thomas Leighton was a prominent politician, soldier, and governor of Guernsey and Jersey. He married a woman named Anne Knollys, who was the daughter of Catherine Carey, who was the daughter of Mary Boleyn. Mary Boleyn was the sister of Anne Boleyn, who was the second wife of King Henry VIII.
Kate Middleton’s mother, Carole Middleton, is descended from the Boleyn family through Mary Boleyn. Meanwhile, Prince William is descended from Sir Thomas Leighton through his father, Prince Charles. Thus, William and Kate are distant cousins, sharing a common ancestor from the 16th century.
However, it is important to note that such a distant familial connection is not uncommon among the British royal family. The royal family tree is incredibly complex, with many intermarriages and connections between different branches of the family. For example, Queen Elizabeth II and Prince Philip are also related through their shared ancestry.
In fact, many royal families across Europe have intermarried over the centuries to maintain political alliances and preserve their dynastic power. This has led to a significant degree of interrelatedness between European monarchs, with many sharing a common ancestry.
It is also worth noting that while William and Kate are technically distant cousins, their relationship is not particularly close. The two did not meet until they were students at the University of St. Andrews in Scotland, and their shared ancestry is not a significant factor in their relationship or their roles within the royal family.
Overall, while Prince William and Kate Middleton are distant cousins through their shared ancestry, this familial connection is relatively minor and not a significant factor in their relationship or their roles within the royal family.