Slightly different results (sometimes) for searchForFacetValues() if sorting by count or by alpha

here’s my code:

$(function() {
    var algolia = algoliasearch(appid, token);
    var index = algolia.initIndex('main');
    var sortby;
    window.search = function(sortby='alpha') {
	var facetFilters = [];
	for (var refine in refinements) {
	    if (refinements[refine]) {
	        facetFilters.push(refine);
	    }
	}
	
	index.searchForFacetValues({
	    facetName: 'cats',
	    maxFacetHits: 100,
	    sortFacetValuesBy: sortby, 
	    maxValuesPerFacet: 100,
	    facetQuery: $("#inputfield").val()
	}, searchCallback);
    }
    
    $("#inputfield").keyup(function() {
	refinements = {};
	window.search();
    }).focus();

    if ($("#inputfield").val() === '') {
	window.search();
    }
});

And I have a couple of radio inputs to change the sort order and some code to handle that:

$('input[type=radio][name=sortby]').change(function() {
    if (this.value == 'count') {
        window.search(sortby='count');
    }
    else if (this.value == 'alpha') {
        window.search(sortby='alpha');
    }
});            

It works but sometimes, I get slightly different results when switching between ‘count’ and ‘alpha’.

What could cause that?