Julia Poff nursed a grudge that prompted her to mail homemade explosive devices to President Barack Obama and Greg Abbott, the governor of Texas, the authorities said, adding that hair from a pet cat helped them connect her to one of the bombs.

Court records say her story began years ago when Ms. Poff did not get support from her ex-husband and, for reasons that were unclear, she blamed Mr. Abbott, who was the state’s attorney general at the time.

Ms. Poff, 46, had applied for Social Security benefits and her applications were denied, court records show. Also, she had said she did not like Mr. Obama, according to court testimony.

So, on Oct. 2, 2016, Ms. Poff mailed homemade explosive devices to Mr. Abbott at the governor’s mansion, Mr. Obama at the White House and the commissioner of the Social Security Administration in Gwynn Oak, Md., federal prosecutors said.