"Heart" here is a metonym for a person's inner consciousness, thoughts, motivation, or feelings. AT: "thought to himself" (See: [[rc://en/ta/man/translate/figs-metonymy]])
"Heart" here is a metonym for the people's allegiance and affection. AT: "the allegiance of these people" (See: [[rc://en/ta/man/translate/figs-metonymy]])
These phrases mean basically the same thing and are combined to emphasize Jeroboam's fear that the people would turn again to Rehoboam as king. (See: [[rc://en/ta/man/translate/figs-parallelism]])