Rehoboam has made choices about his life and his faith. They do not conform to the will of God or the Law. God does conform to his promises for better or worse, so the results are soon coming in.
And it came to pass, when Rehoboam had established the kingdom, and had strengthened himself, he forsook the law of the LORD, and all Israel with him. And it came to pass, that in the fifth year of king Rehoboam Shishak king of Egypt came up against Jerusalem, because they had transgressed against the LORD, With twelve hundred chariots, and threescore thousand horsemen: and the people were without number that came with him out of Egypt; the Lubims, the Sukkiims, and the Ethiopians. And he took the fenced cities which pertained to Judah, and came to Jerusalem. 2 Chronicles 12:1-4
The problem for a ruler is that his personal choices may affect the entire nation. We are facing choices today about our presidential elections, and we have no good choices. Our political leaders are chosen by the blind, and so the blind will lead us. For Israel a king made the choices for them, but they had also empowered that king. He was about to learn how his choices were seen by the God he has forgotten.
Then came Shemaiah the prophet to Rehoboam, and to the princes of Judah, that were gathered together to Jerusalem because of Shishak, and said unto them, Thus saith the LORD, Ye have forsaken me, and therefore have I also left you in the hand of Shishak. Whereupon the princes of Israel and the king humbled themselves; and they said, The LORD is righteous. And when the LORD saw that they humbled themselves, the word of the LORD came to Shemaiah, saying, They have humbled themselves; therefore I will not destroy them, but I will grant them some deliverance; and my wrath shall not be poured out upon Jerusalem by the hand of Shishak. Nevertheless they shall be his servants; that they may know my service, and the service of the kingdoms of the countries. 2 Chronicles 12:5-8
God sent a messenger and the leaders of Judah responded with humility. God reduced their sentence because of their humility. Yet there was still a bad taste to be remembered about their former pride.
So Shishak king of Egypt came up against Jerusalem, and took away the treasures of the house of the LORD, and the treasures of the king’s house; he took all: he carried away also the shields of gold which Solomon had made. Instead of which king Rehoboam made shields of brass, and committed them to the hands of the chief of the guard, that kept the entrance of the king’s house. And when the king entered into the house of the LORD, the guard came and fetched them, and brought them again into the guard chamber. And when he humbled himself, the wrath of the LORD turned from him, that he would not destroy him altogether: and also in Judah things went well. 2 Chronicles 12:9-12
The glory of Israel is changing from gold to brass in this reign. Rehoboam led Israel in the first steps of failure, and returned them partially in humility. There is still a price to be paid for sin, even after one repents. In some cases society requires that judgment be rendered in court for trespass against our laws and communities. God forgives us but government must punish per their laws.
So king Rehoboam strengthened himself in Jerusalem, and reigned: for Rehoboam was one and forty years old when he began to reign, and he reigned seventeen years in Jerusalem, the city which the LORD had chosen out of all the tribes of Israel, to put his name there. And his mother’s name was Naamah an Ammonitess. And he did evil, because he prepared not his heart to seek the LORD. Now the acts of Rehoboam, first and last, are they not written in the book of Shemaiah the prophet, and of Iddo the seer concerning genealogies? And there were wars between Rehoboam and Jeroboam continually. And Rehoboam slept with his fathers, and was buried in the city of David: and Abijah his son reigned in his stead. 2 Chronicles 12:9-12
God sent messengers with warnings, but Rehoboam had not made an effort to get those warnings from God himself. God had to initiate the warnings because the king would not invest time in prayer, bible study, and godly fellowship. The trinity requires our willing participation; he calls whosoever will.