"He speaks of himself as having, through the favor of God, put himself
into a strong position - a position where he feared no enemy and no
change; where he thought himself entirely secure - the state of
"prosperity" to which he had referred in the previous verse. In that
state, however, God showed him that there was no real security but in
his favor: security not in what a man can draw around himself, but in
the favor of God alone." ~Barnes' Notes on the Bible (commentary)