I actually wound up getting to the bottom of this one with your help. It all comes down to an implementation detail in PHP arrays.
Basically, when items are filtered you wind up with gaps in your numeric indexes.
[0 => 'Kentucky', 3 => 'Fried', 4 => 'Chicken']
When no items are filtered, you still "get" indexes. You just get all of them
[0 => 'Kentucky', 1 => 'Fried', 2 => 'Chicken']
But, in PHP, that gets "simplified" to
['Kentucky', 'Fried', 'Chicken']
PHP's weird numeric indexes are the culprit here. This has ramifications when you're returning JSON (one returns an object, one an array). I wish that PHP treated Map-Like Arrays and Array-Like Arrays more separately than this though.
Take this last example
array_keys([1, 2, 3]);
This will return
[0, 1, 2]
Any array, no matter what, has keys. That just really confuses JSON serializers I guess. In fact, now I'm curious how the serializers know when to differentiate between arrays and objects. It must be whenever the indices start at 0 and follow sequentially, in order, after that.