Beside eSIMs, you can also buy physical SIM cards for many countries in advance. Just look for terms such as global sim, travel sim, global prepaid and similar. However, I did not have a good experience with this on a trip because initially many countries were included but during the term several providers left the network and the card was therefore not really usable.
Getting SIM cards on the road can be easy or a little more time-consuming depending on the country. In many countries you will find people selling them at the borders or at the latest in the next town. I use a small WiFi router for different SIMs when I'm on the move, so I don't always have to take the smartphone apart and it also has the advantage that several people can access the router.
However, if I really want or need to have stable internet while overlanding, I would now look into starlink. The constant changing of SIM cards ion longer trips can get annoying. In addition, although data volume is usually cheap in many countries, the network coverage is also given depending on the area, but there is sometimes a lack of bandwidth. Local WiFi is usually not a real alternative either.