Ah the bible, you would never mistake it for hagiography. The final story of Israel’s greatest king, concluding this long pair of books about him, is unflattering and strange. Anti climactic.
He takes a census of fighting men. For some reason this is a great sin, and a God gives him a sort of multiple choice “chose your punishment. He chooses plague.
He feels the weight of it, touchingly comparing it to punishing sheep for the sins of the shepherd. He buys a threshing floor, some sort of rural building, to offer a sacrifice and ends the plague. And the book.
Commentator says the census is a sin because it is about owning the army, taking pride in it. Its a boast, a failure to give God the glory. All of his advisers and generals tell him not to do it, but he does anyway. Its a strangely real way to end the book.