I have no idea what happened without seeing code or poking through the db, but...
it may work because the urls come from the
You might still have values for the categories in there.
But you still need to investigate what happened to the url keys.
Maybe the db is corrupted.
Check if you have values in the
catalog_category_entity_vacrchar for the
You can get the id of the attribute like this:
WHERE attribute_code = 'url_key' AND
entity_type_id = (SELECT
entity_type_code = 'catalog_category')
Then get the id from the query above and run
SELECT * from catalog_category_entity_varchar where attribute_id = ID_FROM_QUERY_ABOVE
There is also the possibility that you still have values for the url keys at store view level, but you are missing the ones for the default values scope.
This way the website can function without any issues, but it creates confusion for the admins.