What is the difference between State API vs UserData API?
You find real world examples for State API in the key_value table under the collection state:
comment.maintain_entity_statistics
field.field.deleted
install_time
locale.translation_last_checked
search_api.index.default_index.has_reindexed
system.cron_last
system.maintenance_mode
update.last_check
webform.version

The first part of the name is usually the module. In these examples they are core and the popular contrib modules Search API and Webform.
In contrast UserData API is obviously specific to the user, not the entire system. You would use it for data you don't want to store in a user field. Because it is easy to add user fields in code and config this service is rarely used in Drupal 8+.