Thus saith the LORD, Ye shall not go up, nor fight against your brethren the children of Israel: return every man to his house; for this thing is from Me. – 1 Kings 12:24
How was “this thing” from God? Well, clearly, it was from God in two ways. First, it was so as a matter of prophecy. The prophet Ahijah had prophesied that the ten parts of the rent garment which were given to Jeroboam should be symbolic of the ten tribes that would be given to him when they had been torn away from the house of David. The prophecy was literally fulfilled, as God’s words always are.
And, secondly, “this thing” was from God as a matter of punishment. He sent it as a punishment for the sins of the house of David of which Solomon had been guilty when he set up other gods before the Most High, and divided the allegiance of his kingdom from Jehovah by bringing in the gods of Moab, and Ammon, and Egypt. God ordained this evil that He might chastise the greater evil of want of loyalty to Himself on the part of His servant Solomon. Yea, my brethren, God setteth evil against evil that He may destroy evil, and He uses that which cometh of human folly that He may manifest His own wisdom.
So there are some events which are specially from the Lord, although it seemeth not so; and this is to us often a great source of consolation. We have said to ourselves, “However did things get into this tangle and snarl?” …Still, the Lord liveth, and the rock of our salvation faileth not. As He makes the wrath of man to praise Him, so doth He also with the folly and the wickedness of man, and the remainder of both He doth restrain. “The Lord sitteth upon the floods; yea, the Lord sitteth King forever.” Hallelujah! ~ C.H. Spurgeon
https://www.blueletterbible.org/Comm/spurgeon_charles/sermons/2476.cfm