Answer
Miguel I's claim to the throne was due to his older brother Pedro IV ruling the Brazilian Empire. He was the heir to the throne of Portugal, but his father, João VI, died while he was still in Brazil. João's younger brother, Pedro, was the regent of Portugal and was crowned Emperor of Brazil. When Pedro abdicated in 1831, his son, Pedro II, succeeded him.