All users that are not state=deactivated (a field you can adjust yourself) is per definition active and have a license assigned. You see them on the users page in BC.
So if you create 22 users and you have no users deactivated, you have 22 users with one license assigned each. And those are the users on the users page in BC.
All users in state=active have a license assigned to them. You can revoke it by setting them to state=deactivated (and then they cannot login to BC). And you can assign it again by setting state=active (so they can login to BC).
There is nothing odd in you beeing able to create 22 users when you have 20 licenses. Because as explained BC includes two "free" restricted licenses for your auditor and your support (business central partner).
You are NOT allowed to use those two licenses for anything else (like regular users etc.). You are only allowed to use them for your auditor and support.
Note: this is (currently) a license term limitation, not a technical limitation - that is why you was able to create 22 users. To be within your 20 users license and be in line with the license terms, you'll need to deactivate two of them again or purchase two additional user licenses (unless two of your users are in fact for your auditor and support (business central partner) :-) ).
I hope this explains it more clearly.