When you initialise an empty integer array the initial value for each of the item is zero, there for each index of arr will contain 0
int[] arr = new int[500];
arr[0] = 0;
arr[1] = 0;
//...
arr[500] = 0;
The ASCII value for x is 120, y is 121 and z is 122, since the arr field contains 500 item then 120, 121 and 122 is in range.
In your loop you are adding 1 to each of the element. therefore in your str1 = "xxyz" when the first x is encounter 1 is added to index arr[120] so arr[120] becomes 1 and when x is encounter again 1 is added to the value which makes arr[120] becomes 2.
arr[(int) 'x'] += 1 //=> arr[120] + 1 = (0 + 1) = 1
arr[(int) 'x'] += 1 //=> arr[120] + 1 = (1 + 1) = 2
arr[(int) 'y'] += 1 //=> arr[121] + 1 = (0 + 1) = 1
arr[(int) 'z'] += 1 //=> arr[122] + 1 = (0 + 1) = 1
arr['x'] is possible because in java char data type is a single 16-bit integer and int is 32-bit signed integer.
Update:
In the continuation for the program the second loop on str2 is deducting one at the char index, if str2 is a permutation of str1 the value all the item in arr should reset to 0.
After the loop on str1. The values in the array are
arr[0] = 0
//...
arr[120] = 2 //arr['x']
arr[121] = 1 //arr['y']
arr[122] = 1 //arr['z']
//...
arr[500] = 0
When str2 = "yxzx"
arr[(int) 'y'] -= 1 //=> arr[121] - 1 = (1 - 1) = 0
arr[(int) 'x'] -= 1 //=> arr[120] - 1 = (2 - 1) = 1
arr[(int) 'z'] -= 1 //=> arr[122] - 1 = (1 - 1) = 0
arr[(int) 'x'] -= 1 //=> arr[120] - 1 = (1 + 1) = 0
After the loop on str2 the values will be reset to 0
arr[0] = 0
//...
arr[120] = 0 //arr['x']
arr[121] = 0 //arr['y']
arr[122] = 0 //arr['z']
//...
arr[500] = 0
Hence looping through all the array if all the values are zeros then str2 is a permutation of str1.
x==120. You can check some ASCII table to see values of all the characters.