The Raspberry Pi runs a full blown operating system on it. Usually it is Raspbian or a Raspbian derivate. On Raspbian you run multiple programs at the same time (multi tasking). The Raspberry Pi has GPIO pins, but no analog input pins.
The Arduino runs one program (single tasking), and that’s it. The Arduino has analog input/output pins.
When do you use what?
That depends on the task(s). But basically, if it is a “single task job”, use an Arduino. For everything else, use a Raspberry Pi.