MySQL group replication - how to find queries causing replication lag?
Turn on the slowlog on both machines.  What version of MySQL are you using?  Here are good settings to have for a relatively new version:
log_output = FILE
slow_query_log = ON
slow_query_log_file = (fullpath to some file)
long_query_time = 1
log_slow_admin_statements = ON
log_queries_not_using_indexes = OFF
log_slow_slave_statements
log_slow_extra = ON

More:  http://mysql.rjweb.org/doc.php/mysql_analysis#slow_queries_and_slowlog
A possible cause of what you are seeing:  An ALTER that takes some time and hits tableA is replicated.  Meanwhile, other things are happening (read or write) to tableA.  The above settings will probably catch the ALTER.
Another thing to look for (but hard to see) in the slowlog:  A bunch of queries ending at about the same second.  This usually means that one of them took a long time and was blocking the others (either directly or indirectly).
In any case, use pt-query-digest; its default sort is to put the &quot;worst&quot; queries first.  Then...

The blocker may be among the first few.
The first few are likely to be queries that you should work on improving -- better indexing, reformulation, etc.
Sometimes a &quot;worst&quot; query is a very fast query that was blocked by the blockage; that is it was a &quot;victim&quot;, not a &quot;villain&quot;.  Example:  UPDATE ... WHERE primary_key = 123 taking second(s) or even minute(s), not milliseconds.