To add to the other comments:
RL is also extremely useful in scenarios where rules cannot easily be made explicit. Think of riding a bike or flying a helicopter or gripping objects with a robot arm. Here we can more easily define the reward function - but the agent has to figure out how to do things (to maximise expected reward).