I see it as how close you were to catching it.
When you throw a ball, and the game's determining whether you caught the Pokemon or not, I think of it like a number out of 100 that you need to roll higher than, and the number of shakes is how close you were.
So if you've got a 20% chance to catch a Pokemon, then you need to get 81 or above. If for example you roll a 2, then it'd break out immediately, as if to say "not even close". However if you were to roll 75, then it'd shake 3 times before breaking out, but it's purely visual. I've had the app crash during a Pokemon catch and still end up catching the Pokemon.