The fact that the two constructions are used in different scenarios is because of the essential differences between Raspberry Pi and Arduino: Arduino boards function as microcontrollers, which means that they can execute a pre-installed application as previously defined without much delay. They’re delivered with their own development environment, which has various ready-to-use libraries available and saves a large amount of programming work. Raspberry Pi, as a minicomputer with its own operating system, can complete substantially more complex tasks such as, for example, running multiple applications in parallel or in succession. It also has a number of interfaces and ports standardly available (HDMI, WiFi, LAN) that would have to be added to Arduino boards using shields.
In simpler terms, Arduino is particularly suitable for projects in which a simple task is to be executed repeatedly. For a task such as measuring the outside temperature and showing it on a display, for example, the microcontroller is the perfect platform. However, if you want to not only measure the outside temperature, but also check the weather forecast and start the garden irrigation system on the basis of previously defined criteria (e.g. high temperature and low rain probability), then Raspberry Pi is the better choice.