Buckingham was related to the royal family of England so many different ways that he was his own cousin many times over, but his connections were all through daughters of younger sons. His chances of inheriting the throne would seem remote, but in the end the internecine conflicts between and within the Houses of Lancaster and York brought him within striking distance of a crown. Some even say Buckingham played no little role in formenting some of those conflicts.
Buckingham was second-cousin or closer to four kings:
Then Parliament declared Edward V illegitimate and offered Richard the throne, and he accepted it and became Richard III. After dithering between them for a short while, Buckingham started working with John Morton, Bishop of Ely, in the interests of Buckingham's second-cousin Henry Tudor and against those of King Richard, even though it meant being on the same side with his in-laws, the Woodvilles.
When Henry Tudor tried to invade England to take the throne from Richard in October 1483, Buckingham raised an army in Wales and started marching east to support Henry. By a combination of luck and skill, Richard put down the rebellion: Henry's ships ran into a storm and had to go back to Brittany, and Buckingham's army was greatly troubled by the same strom and deserted when Richard's forces came against them. Buckingham tried to escape in disguise but was turned in for the bounty Richard had put on his head, and he was convicted of treason and beheaded in Salisbury on 2 November.
Following Buckingham's execution, his widow, Katherine, married Jasper Tudor, 1st Duke of Bedford.
Buckingham's motives in these events are disputed. His antipathy to Edward IV and his children probably arose from two causes. One was his dislike for their mutual Woodville in-laws, whom Edward greatly favored. Another was his interest in the Bohun estate. Buckingham had inherited a great deal of property from his great-great-grandmother, Eleanor de Bohun, wife of Thomas of Woodstock and daughter of the Earl of Hereford, Essex and Northampton. Eleanor's sister and co-heir Mary de Bohun married Henry IV, and so the other half of the estate was eventually inherited by Henry VI. When Henry VI was deposed by Edward IV, Edward incorporated that half into the Crown property. Buckingham claimed those lands should have devolved to him instead. It is likely that Richard III promised to settle the estate on Buckingham in return for his help seizing the throne.
After Richard's coronation he did award the other half of the Bohun estate to Buckingham, but it was conditional on the approval of Parliament. Historians disagree on whether this condition was in fact a way for Richard to appear to keep his promise while actually breaking it. So it might have been a motivation for Buckingham to turn against Richard.
It's also possible that, if Richard was responsible for killing the Princes in the Tower, the murders caused Buckingham to change sides. On the other hand, Buckingham himself had motivation to kill the Princes. He was next in the Lancastrian line after his cousins Henry Tudor and Henry's mother. If he killed the Princes and threw the blame on Richard, he could forment a Lancastrian rebellion. Then after eliminating Henry he could take the throne. Some historians take this line of reasoning. In fact, a few go even further and claim Buckingham's plotting started much earlier in Edward IV's reign. If they are right then Buckingham had a very elaborate and lengthy plan, but one which very nearly succeeded. --It is worth noting in this connection that according to a manuscript discovered in the early 1980s in the Ashmolean collection, the Princes were murdered "be [by] the vise" of the Duke of Buckingham. There is some argument over whether "vise" means "advice" or "devise," and, if the former, in what sense; for a discussion of the matter, see the article by Richard Firth Green, who discovered the manuscript, in the English Historical Review of 1984.