You are working as an HR professional in an industry. As you feel you have plenty of free time, you are simply roaming around the factory. At one point, a machine developed a snag. Even though you do not know about the machine and are not supposed to do anything with it, you are simply meddling with the machine. If your finger gets injured due to a cut during this time, it does not arise out of or in the course of employment. Therefore, as an HR professional, you are not eligible to receive any compensation for the sustained injury.
However, if the concerned engineer, with the help of a mechanic, repairs the machine and the mechanic sustains an injury in the course of employment, then it is considered to arise out of and in the course of employment. In this case, the mechanic is eligible to receive compensation for the injury.
I hope this clarifies the concept of "arising out of and in the course of employment."