This is a quick one.
Beat 'em up Z checks simply check whether the player & enemy are in the same Z-range before they activate hitbox collisions.

When you are out of range, none of your attacks will hit even if your hitboxes overlap with the enemy's hurtboxes.

Once you're in range, it essentially turns into fighting game collisions, just without a pushbox (usually). Each game has its own ranges, older ones tend to be a lot more brutalist in their approach, while newer ones are more lenient.
The only difference is that unlike fighting games, in beat 'em ups you can wiggle your character's "ground" position up and down a bit, depending on the Z check range. As a result you might have some funky hitbox interactions where, because you're positioned below an enemy as they're doing a high jab, your hurtbox might be below their jab's hitbox and as such, it won't hit. These interactions are very niche though.
Attacks don't really have their own, unique Z ranges in older games afaik, however some attacks like Haggar's desperation attack disable Z-checking and just use the attacks' X/Y hitboxes, creating the feel that they have an extra dimension and can reach where your normal attacks cannot.
Grabs are simply hitboxes which appear next to your characters when you start walking around. The exact same rules apply to them.
For hitboxes in particular, check out this blog :
https://dammit.typepad.com/blog/2010/10/recent-hitbox-work.html
