The algorithm isn't doing merge sorting. It just concatenates two arrays, a[] and b[], in your case. You are getting the resulting array as sorted because all elements in your array are sorted. If you put in some random numbers in between and disturb the order, the result won't be sorted anymore.
For ex: if I had a = {100, 10, 1} b = {20, 40, 60} then c would be {100, 10, 1, 20, 40, 60}