When Rehoboam got back to Jerusalem he called up the men of the tribes of Judah and Benjamin, 180,000 of their best soldiers, to go to war against Israel and recover the kingdom.
At the same time the word of God came to Shemaiah, a holy man,
"Tell this to Rehoboam son of Solomon, king of Judah, along with all the Israelites in Judah and Benjamin,
This is God's word: Don't march out; don't fight against your brothers the Israelites. Go back home, every last one of you; I'm in charge here." And they did it; they did what God said and went home.
Rehoboam continued to live in Jerusalem but built up a defense system for Judah all around:
in Bethlehem, Etam, Tekoa,
Beth Zur, Soco, Adullam,
Gath, Mareshah, Ziph,
Adoraim, Lachish, Azekah,
Zorah, Aijalon, and Hebron - a line of defense protecting Judah and Benjamin.
He beefed up the fortifications, appointed commanders, and put in supplies of food, olive oil, and wine.
He installed arms - large shields and spears - in all the forts, making them very strong. So Judah and Benjamin were secure for the time.
The priests and Levites from all over Israel came and made themselves available to Rehoboam.
The Levites left their pastures and properties and moved to Judah and Jerusalem because Jeroboam and his sons had dismissed them from the priesthood of God
and replaced them with his own priests to preside over the worship centers at which he had installed goat and calf demon-idols.
Everyone from all the tribes of Israel who determined to seek the God of Israel migrated with the priests and Levites to Jerusalem to worship there, sacrificing to the God of their ancestors.
That gave a tremendous boost to the kingdom of Judah. They stuck with Rehoboam son of Solomon for three years, loyal to the ways of David and Solomon for this period.
Rehoboam married Mahalath daughter of Jerimoth, David's son, and Abihail daughter of Eliab, Jesse's son.
Mahalath bore him Jeush, Shemariah, and Zaham.
Then he married Maacah, Absalom's daughter, and she bore him Abijah, Attai, Ziza, and Shelomith.
Maacah was Rehoboam's favorite wife; he loved her more than all his other wives and concubines put together (and he had a lot - eighteen wives and sixty concubines who produced twenty-eight sons and sixty daughters!).
Rehoboam designated Abijah son of Maacah as the "first son" and leader of the brothers - he intended to make him the next king.
He was shrewd in deploying his sons in all the fortress cities that made up his defense system in Judah and Benjamin; he kept them happy with much food and many wives.