The king mourns, the prince is wrapped in despair, and the hands of the people of the land are paralyzed by terror. According to their way I will do to them, and according to their judgments I will judge them, and they shall know that I am the LORD.
God does not judge humanity in any way that is not in keeping with His wisdom and our ways. God knows people intimately. He knows when we obey in worship and He knows when our hearts are self-centered and far from Him. Human beings cannot ever hide from God. He knows who we are and what we feel and why we do what we do.
As God announces His actions of judgment through Ezekiel, He does so well aware of the condition of His people. They are spiritually devoid of all respect for Him. They are also filled with dread at what they see coming though the Babylonian army. And He warns them of even more disaster to come.
There is a principle articulated here that informs us about the character of God in judgment. God never brings an undeserved judgment. And often God uses the natural outcome of our actions in His judgment. He promises to judge the Jews "according to their ways" and "according to their judgments". This was the way in which the outcomes of their actions would mete out the hardships they would face. Sin brings misery. And that is what the nation would know as God allowed their choices to follow these outcomes.
This is still true. The wages of sin is death. The reason death and pain exist in the world is because of human choices to disobey God and turn away from Him. And the outcome of that is that all sin and selfish striving ends in mourning, misery, and judgment.