Prosperous times often sway man to trust in himself rather than God.
And in my prosperity I said, I shall never be moved. (Psalms 30:6 KJV)
David was reflecting upon times in his life many of blessings and prosperity. It is in affluent times that it is so easy to turn away from the things of God and look unto ourselves instead. David faced both times of affluence and want in the spiritual valleys and peaks of his life. Although he faced a time of affluence he understood that either famine or destruction could be hiding just around the next corner.
David understood that in his own strength and power he was not able to bring about lasting spiritual prosperity or material wealth. He knew that it was God who ultimately supplies and can as well choose take away things we admire and hold onto as idols in our lives rather than trusting only in Him.
God desires to use vessels which are empty of everything of this world and filled to overflowing with Him. If God deems it necessary to remove assets from our life in order to get our attention off of our material possessions and perceived spiritual success to being narrowly focused onto His will for our life He will empty us of everything necessary so that we rely only on Him to bring about His good will in our life.