The term Industry 4.0 is mainly used for smart factories, in which cyber-physical systems interact with each other and the internet and make decisions. In contrast, Robotic Process Automation (RPA) is mainly used in offices for back office processes. Industry 4.0 for the back office, so to speak.
Robotic Process Automation automates high-volume, standardized, and structured processes. RPA connects different software applications intelligently, for instance legacy systems with newer applications.
It's why it is called Robotic Process Automation: What robots do on the factory floor, RPA does in offices. Humans no longer need to do the same tasks over and over again, whether with screwdrivers or excelsheets. Instead, robots take over that part.
Unlike Industry 4.0 robots, RPA's robots aren't physical robots but digital ones. RPA is software that can handle other applications. They do so over the user interface, using their own login codes and doing the same things a human would do: copy & paste, compare data and click on buttons.
Similar to Industry 4.0's smart factories, the RPA robots also accrue lots of process data because everything the robots do is documented. Valuable data that can be used to further optimize processes and gain business insights.
Humans, on the other hand, can focus on value-adding, interesting tasks instead of on routine ones thanks to automation.
For the future, both Industry 4.0 and Robotic Process Automation signal more intelligent systems, better integration, higher data volume and fewer routine tasks.
In short, Robotic Process Automation is Industry 4.0 for the office.