The sort-keys operation sorts the keys of JSON objects in alphabetical order. It applies the sorting recursively, so object keys are sorted not only at the top level but also inside nested objects. Arrays are preserved as arrays, while any objects contained inside them are processed in the same way.