The mediawiki.page_change schema designed in T308017: Design Schema for page state and page state with content (enriched) streams created a reusable user entity schema. This schema has a groups string array field to represent a user's groups.
When emitting mediawiki.page_change events from EventBus, the UserEntitySerializer calls UserGroupManager getUserEffectiveGroups to set the groups array. getUserEffectiveGroups returns both 'implicit' and 'explicit' user groups.
In T423952: Create mediawiki.user_change event stream, we want to emit an event for when a user's groups change. We can use the UserGroupsChanged hook. However, this hook only gives us the old and new explicit user groups.
We can choose to set user groups to the union of explicit $newGroups and getUserEffectiveGroups, but we have no way of knowing what the prior_state 'implicit' user groups are.
This means that prior_state.user.groups will only contain prior explicit groups, while user.groups will contain current implicit+explicit groups.
If explicit and implicit groups were in different fields, we could choose to only include prior_state for things that changed when UserGroupsChanged was fired: explicit user groups.