"Heart" 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]])
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]])