Pokeballs save the lives of pokemon.
In the wild, as the laws of nature dictate, there is a food chain and pokemon kill other pokemon for various reasons. Everytime you beat a pokemon in the wild, its health bar hits zero and it disappears, never to be seen again. You never meet the same wild pokemon because you killed all everyone of them after you beat it.
The pokeball system, which was designed for storage and battling, kept pokemon from dying in battle. In olden times, it was inefficient for you to keep training the same species of pokemon over and over gain due to it dying in battle, and ethics also. The system detects when health is critically low and when the pokemon is unable to battle any longer by checking its vital signs, and pulls it back into storage, effectively keeping it from perishing.
Prime examples: A hyperbeam can absolutely destroy an environment, as well as kill any pokemon if the user is strong enough or if the opponent is weak. A hyper beam on a level 1 Pidgey? Complete kill in the wild, but if the pidgey is printed into the system of a pokeball, it is pulled back right before the final stroke by its pokeball. Though this is very useful in not having your best buddies die, the pokeball should still be taken to be treated at healthcare centers.
Also, it provides a variety of uses such as easy transportation and freedom of space while traveling, as well as recreating an environment that the pokemon has grew up in.
For example, a fish cannot survive on land, but in many cases we see pokemon that belong in the water float in the air as if it was still in the water! The pokeball alters (safely) the pokemon to fit in any environment, such as changing its internal composition to be able to breath air while still allowing it to breath water normally. An addition program as called.
TBC