When do I use inversions in an array?

In problems like the 15 Tile Problem or Larry’s Array problem, we use inversions in the array as a method to solve.

But what’s the principle behind this method and how do I know when to use inversions?