The users without licenses you mentioned should belong to external users.
We can create a report through power shell to see how many external users in your tenant.
Report on external users in SharePoint Online
Third-party information disclaimer:
The third-party product that this article discusses is manufactured by a company that is independent of Microsoft. Microsoft makes no warranty, implied or otherwise, about the performance or reliability of third-party products referenced in this article.
In addition, If you want to view the behavior of external users, you can actually use audit log.
For specific information, you can check the document below:
Use sharing auditing in the audit log
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.