Most of them look for window events. I've not seen an RPA tool that actually reads the screen like a human, even though that's how you're thinking about it.
The more serious players shadow Windows events.
The real stuff does process injection and directly shadow copies / modifies in-memory data structures.